Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling setfocus from text box giving error
Message
 
To
11/03/2002 09:06:52
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00629840
Message ID:
00630938
Views:
21
Is the form HELP1 modal?
In any case, since you run another form from within the grid textbox method, many things can happen as the grid will loose focus when the help form launches before the Valid method ends.

>Hi Nick,
>
>I am sorry dispatching long code as per your instruction. This code is written on second column valid event of my grid text box. after selection I want to skip on third column text box which is not going.
>
>
>*publ x
>*x=0
>publ y
>y=0
>
>
>*IF Subsidiary code IS BLANK EXECUTE THIS LINE
>
>factp=thisform.grid1.column1.combo1.value
>fsbcd=thisform.grid1.column2.text1.value
>
>If len(ALLT(fsbcd)) = 0
>	
>	if factp="C"
>	
>	select code,name,GLCODE from customer order by code into cursor curcust
>	
>	do form help1
>
>	if y=1
>
>	thisform.grid1.column2.text1.value=ccust
>	THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
>	THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
>	thisform.grid1.column2.text1.refresh()
>	*thisform.grid1.column3.text1.setfocus()
>	
>	retu
>	
>	else
>	
>	return .f.
>	
>	endi
>	endi
>	
>	if factp="S"
>	
>	select code,name,GLCODE from supplier order by code into cursor curcust
>	
>	do form help1
>
>	if y=1
>
>	thisform.grid1.column2.text1.value=ccust
>	THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
>	THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
>	thisform.grid1.refresh()
>	retu
>	
>	else
>	
>	return .f.
>	
>	endi
>	endi

* more code here
	
>endi
>						
>****** END
>
>
>>Hi Sajjad,
>>
>>Could you post here that code? Which method did you place it in - textbox.Valid()? Do I understand it right that you press Enter on second column and you suppose it to go the third column?
>>
>>>Hi Nick,
>>>Thanks a lot for helping. I face one more problem in grid. i am using validation on second column of grid. when i press enter its invoke help list for that column..my code validate perfectly and selection coming in column but curos not moving to another text box. If i click mouse button on next column once more valid event fire and than after selection cursor going on another text box. Any idea to skip column in grif after validation please....
>>>
>>>Regards,
>>>Sajjad
>>>
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform