Close Current Form

jeo

Registered User.
Local time
Today, 16:24
Joined
Dec 26, 2002
Messages
299
I can't seem to figure out how to close current form.
I have form1 and I open form 2 from form1. I can't figure out how to close form1 when form2 opens.
Any help would be greatly appreciated.
 
Hi Jeo,

Add this to your routine which opens form2
Code:
DoCmd.Close

That should do it.
 
OK, could you please be more specific as to where to put that event?
Are you saying I should insert docmd.Close for Form2 Open event?
I tried several combinations of everything and I just can't seem to figure it out.
Thanks!
 
jeo said:
OK, could you please be more specific as to where to put that event?
Are you saying I should insert docmd.Close for Form2 Open event?
I tried several combinations of everything and I just can't seem to figure it out.
Thanks!
How do you open your form2 by a button? If yes, then put DoCmd.Close at the end of the instrustions.

Le
 
Yes, and I did that, but that code closes form2 as soon as it comes up leaving form1 open.
Any ideas? Thank you!
 
FROM FORM 1:
Docmd.Close acForm, "form1", acSaveNo
Docmd.OpenForm "form2"

If you have a command button from Form 1 and when clicked (OnClick - [Event Procedure]), simply put the above code above within (just the Docmd lines of code).

You want to close the form first then open where you want the user to go. Ensure to define what you are closing, the name of the item being closed, and whether to save design changes or not, etc...etc...etc...

:D :D :D :D :D
 
Last edited:
Thank you, thank you, thank you! That worked great!
 

Users who are viewing this thread

Back
Top Bottom