General information
Category:
Forms & Form designer
Hi Michael.
>>However, if I happen to click anywhere else on the form itself, while the combo box is opened, I get an error saying that the setfocus command is not allowed in a valid clause. This doesn't make sense, because the setfocus command works fine from within the combo box. <<
The fact that you can issue a SetFocus() from the Valid() of a combo box is the anomaly. The Valid method is used to decide if a control should be allowed to lose focus. Try switching your setFocus() from the Valid of the combo to the LostFocus(). And don't forget to add a NODEFAULT after you issue the SetFocus() when you move the code to the LostFocus method.
Marcia
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