Close Current Form (1 Viewer)

jeo

Registered User.
Local time
Today, 16:52
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.
 

Jura

New member
Local time
Today, 17:52
Joined
Feb 14, 2006
Messages
7
Hi Jeo,

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

That should do it.
 

jeo

Registered User.
Local time
Today, 16:52
Joined
Dec 26, 2002
Messages
299
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!
 

le888

Registered User.
Local time
Today, 12:52
Joined
Dec 10, 2003
Messages
344
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
 

jeo

Registered User.
Local time
Today, 16:52
Joined
Dec 26, 2002
Messages
299
Yes, and I did that, but that code closes form2 as soon as it comes up leaving form1 open.
Any ideas? Thank you!
 

GamingResources

Registered User.
Local time
Today, 08:52
Joined
May 27, 2005
Messages
13
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:

jeo

Registered User.
Local time
Today, 16:52
Joined
Dec 26, 2002
Messages
299
Thank you, thank you, thank you! That worked great!
 

Users who are viewing this thread

Top Bottom