Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force user to enter values in combo boxes before exiting the form

Status
Not open for further replies.

MrMode

Technical User
Aug 28, 2003
195
0
0
GB
I have a form with a number of text boxes and combo boxes on.

I am not concerned about the text fields being used, but I do need to ensure that the user selects a value for each of the combo boxes.

How do I write code that forces a user to enter select a value from a combo box before closing the form?

Thanks
 
could have a button that they use to close the form. for the onclick event add something like

If combo1 OR combo2 OR combo3 is null then
exit sub
else
docmd.close
 
Or use a variation of jaydeebetoo's code the form_unload event to set
Code:
Cancel = 1
if they haven't used the combo's. This will stop the form unloading.

Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top