View Full Version : the most retarded question ever


jenntheblond
07-19-2001, 11:32 AM
Anyone besides me could know this. I am trying to run a test to see if information matches up. If it doesn't, the user needs to go fix the problem, thus close the form "matching form" and go elsewhere. My problem is that I am BRAND SPANKING NEW to VBA (i'm trying to wean myself out of macros) and I can't figure out how to close my form. I used the
Docmd.Close acform "matching form" code but it gives me a run-time error and tells me I can't do that while processing an event. What? Help!

tzimak
07-19-2001, 11:46 AM
You don't need all that extra stuff after DoCmd.Close. It's just a button with DoCmd.Close as its Click event.

T

Rich
07-19-2001, 11:46 AM
Yes it seems illogical at first but the form is still handling the event so it can't close it's self, create another form that looks like a message box add a label that says something like entry error or whatever, add another command button, caption OK, on it's event DoCmd.CloseForm1, DoCmd.CloseForm2 Make sure it's modal and pop up are set to yes.
HTH

jenntheblond
07-19-2001, 01:03 PM
Ok I see what you mean. I had a message box popping up, but I'll do a modal box instead that will allow me to close the forms. Thanks!

sbornstein1
07-19-2001, 01:07 PM
Jenn if you need to close another form then you will need: DoCmd.Close acForm, "frmScheduler" and not just DoCmd.Close