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!

Can't use docmd.close while in a form event

Status
Not open for further replies.

Smashie

Programmer
May 11, 2000
19
0
0
GB
I have a text box which has an EXIT event. This event is supposed to check for null in the text box and, if this is the case, to bring up a message box for the user to say that this is a mandatory field. CANCEL EVENT is used if the user has mistakenly forgotten to enter a value (so focus remains in this text box).<br>My problem is that the user may actually want to exit the form. However, when I try to attach docmd.close to the EXIT event I get run time error 2585 (can't perform this action whilst processing a form event.<br>So my question is &quot;How can I close my form following the user response to the on_exit event?&quot;<br><br>Many thanks
 
get rid of the event in the form<br>And check the isNull in the text box on the After update event <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Thanks DougP<br><br>I had got worried when my thread seemed to be the only one not answered.<br>As usual with me, I hadn't explained very well. You're solution would not have worked but then, unless you were psychic (maybe you are), you'd not have known the real problem.<br><br>Anyway, your 'solution' engaged my lateral thought devices and within 5 minutes of reading your response I'd solved my problem!<br><br>Next time I'll think before I cry for help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top