G
Guest
I have a combo box that populates other boxes on a form, works beautifully.
There is no reason a user would click elsewhere on the form and start
entering data, but we all know someone will do that. I have protections to
prevent adding records with null values to tables, so the data is reasonably
safe, but I need to make the operation of the form foolproof.
When the form opens, it defaults to the correct combo box. I have a message
box that fires on loss of focus if the combo box is null telling the nut to
go back and select from the dropdown, but the curser goes to the next in line
box. I would like to put the curser back in the first combo box. If I could
get it to do that I'd be fine.
I've tried using on gaining focus in the second box to go back to the first,
and it works but it also opens up other problems. I don't want to wait until
the user selects the save record command button or wait for the update record
event to validate whether this field is null or not, this form has many
controls., and many of them will not work unless the user selects the
customer from the first combo. I've been able to force people to stay in
check box fields and option groups, but haven't figured out how to force them
to enter data in the combo box before moving on. I've also tried to validate
the box is not null on loss of focus and return to that box but I get errors
that say I can't set focus or alternatively, can't use goto on an empty box.
I've also thought of making all controls invisible or locked until the combo
box is populated, but that all seems too complicated.
I know there is an easy answer. Clearly, I've either left something out or
my code, or I'm barking up the wrong tree.
Any ideas?
There is no reason a user would click elsewhere on the form and start
entering data, but we all know someone will do that. I have protections to
prevent adding records with null values to tables, so the data is reasonably
safe, but I need to make the operation of the form foolproof.
When the form opens, it defaults to the correct combo box. I have a message
box that fires on loss of focus if the combo box is null telling the nut to
go back and select from the dropdown, but the curser goes to the next in line
box. I would like to put the curser back in the first combo box. If I could
get it to do that I'd be fine.
I've tried using on gaining focus in the second box to go back to the first,
and it works but it also opens up other problems. I don't want to wait until
the user selects the save record command button or wait for the update record
event to validate whether this field is null or not, this form has many
controls., and many of them will not work unless the user selects the
customer from the first combo. I've been able to force people to stay in
check box fields and option groups, but haven't figured out how to force them
to enter data in the combo box before moving on. I've also tried to validate
the box is not null on loss of focus and return to that box but I get errors
that say I can't set focus or alternatively, can't use goto on an empty box.
I've also thought of making all controls invisible or locked until the combo
box is populated, but that all seems too complicated.
I know there is an easy answer. Clearly, I've either left something out or
my code, or I'm barking up the wrong tree.
Any ideas?