Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to SetFocus() from Valid()?
Message
From
10/06/2002 14:58:36
Charlie Hancock
California Dept of Public Health
Richmond, California, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
How to SetFocus() from Valid()?
Miscellaneous
Thread ID:
00666645
Message ID:
00666645
Views:
55
My application has two forms visible: one, in the foreground, is a data entry form, the other, in the background, displays a grid of possible duplicate records. The desired behavior is that the user will enter a customer's first & last name in the first form. The last name textbox's .Valid() code then calls a method in the second form that searches for and displays any existing customers with matching names. So far so good. At this point, I want to bring the second form to the top, which is where I'm having the problem.

I know I can't SetFocus() to the second form's grid (or to anyplace else)from the first form's textbox Valid() event. The documentation suggests using .LostFocus() as a place to do that. But when I try, the second form's grid momentarily gets the focus, then focus jumps right back to the first form (in the data entry textbox following the last name textbox). The same occurs when I call the second form's .Show() event. Any ideas on how to keep focus on the second form once it gets there?

Thanks in advance!

Charlie Hancock
Charlie Hancock
Next
Reply
Map
View

Click here to load this message in the networking platform