Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Closing forms once lost focus


Message #1 by "Yvette Deitrick" <Deitrick@P...> on Sat, 24 Feb 2001 13:53:33
How do I close a form once I have gone to another form,

the equivalent of the unload in VB?
Message #2 by "Bob Bedell" <bdbedell@m...> on Sat, 24 Feb 2001 17:33:06
> How do I close a form once I have gone to another form,



Use the OpenForm and Close methods of the DoCmd object.



To experiment, create Form1 and Form2. 



Place a command button on each form. 



In the click event of the command button on Form1 write:



Sub Command1_Click()

  DoCmd.OpenForm "Form2"

  DoCmd.Close acForm, Me.Name

End Sub



In the click event of the command button on Form2 write:



Sub Command1_Click()

  DoCmd.OpenForm "Form1"

  DoCmd.Close acForm, Me.Name

End Sub



This will enable you to toggle between the forms.



See the OpenForm and Close methods in the help file for a list of

the many arguments each method takes.
Message #3 by "Leif N. Eriksen" <Leif_N_Eriksen@y...> on Sat, 24 Feb 2001 20:07:39
> How do I close a form once I have gone to another form,



    DoCmd.Close acForm, "formName"



Message #4 by "Pardee, Roy E" <roy.e.pardee@l...> on Sun, 25 Feb 2001 13:29:09 -0800
DoCmd.Close ObjectType:=acForm, ObjectName:= <<form name goes here>>



-----Original Message-----

From: Yvette Deitrick [mailto:Deitrick@P...]

Sent: Saturday, February 24, 2001 5:53 AM

To: Access

Subject: [access] Closing forms once lost focus





How do I close a form once I have gone to another form,

the equivalent of the unload in VB?


  Return to Index