General information
Category:
Forms & Form designer
Rodolfo,
You are right! I responded back to myself, right before you posted this and explained the situation. This is exactly what I am doing. As I said in the post, I don't know why VFP cares if I am doing a setfocus() in a different form - but obviously it does.
In order to get around it I have done the following:
In my valid I am doing a seek for the text box value. If the seek succeeds I just return true. If it fails, I want to call my lookup form. Previously I was calling the form from inside my valid. Now, instead, if the seek fails I iissue:
this.tag='SEEKFAILED'
then in the lostfocus():
if this.tag='SEEKFAILED'
this.tag=''
do myform
** do the rest
endif
This seems to be working fine.
I am using vfp6, and am not in a position right now to recompile to 7, so, I hope my lostfocus() doesn't fire twice. This will be a big problem if it does. How can I avoid that. How else can I handle this?
Thanks for your help!
>Hello David,
>
>If you have one form (FORM_A) that has some objetcs (Form_A.Text1) and then, you call another form from this object (Form_A.Text1.Valid). For Example: DO FORM_B
>
>So, in FORM_B if you have a SETFOCUS (any event or method) you will receive this error message... It happens because you have a call from a VALID (not necessary the current object).
>
>Sorry about my English, but I think I could explain you what is doing wrong! :-)
>
>[]s!
>
>and... of couse, change the call (DO FORM_B) to LostFocus (instead Valid) and your program will work fine....
>If you are not using VFP 7, you could have problems with LostFocus... sometimes it runs twice...
>
>[]s again!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only