Closing forms

  • Thread starter Thread starter Mike J
  • Start date Start date
M

Mike J

I open a form(menu, open another form with a click of a
button, which then immediately opens up a custom dialog
popup which asks for a password. The problem is that if
they choose the wrong pw, I want it to close the third and
second form and return to the menu. So I used the
docmd.close but execution of code goes back to the 'Open'
event of the second form whch causes an error because the
2nd form is closed.
I though the closing of the form would kill the vba
code/modules too? Am I wrong?
 
Mike,

The Open() event has a Cancel parameter. Setting this parameter = True,
prevents the form opening. You can still check for any other forms/objects
that are required before completing the Open() event. If they're not there,
set Cancel = True.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Back
Top