close two forms at once

laurat

Registered User.
Local time
Today, 08:45
Joined
Mar 21, 2002
Messages
120
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 will have to make sure that the forms are open in the first place (or account for the possibility that they are not open) then you could use:

DoCmd.Close acForm, "FormName1"
DoCmd.Close acForm, "FormName2"

Error handling is the key here.

Cheers

Brad.
 
Hi

In the code behind the button that opens the second form you can add the code in the OnClick event

DoCmd.Close

Put this before the code runs to open the second form or it will close the second form.

HTH

Col
:cool:
 

Users who are viewing this thread

Back
Top Bottom