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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

close two forms

Status
Not open for further replies.

laruajo

MIS
Sep 16, 2002
24
US
I have a form that data is entered in, a button is then pressed to accept the data and take the users to another form where they receive a number. When the users either press the button on the first form to accept the data and go to the other form, or press the close button on the second form, i would like the first form to close. How can I do this??
 
You would add a line after your other commands..

DoCmd.Close acForm, "frmMyForm", acSaveNo


 

Define a global module. In that module, insert the following routine.

Public sub CloseForm1

Docmd.close acform, “form1Name”

End sub

Now, the last line of your on click event of your buttin which accepts your data should be:

CloseForm1()

It should also be called as a part of your on close event for the second form.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top