close a previous form automatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have taken over somebody's project creating an Access Database. As new
forms are opened, the previous ones stay open also. How do I close them
automatically when a new one is opened (like the sign in form)?
 
If you are using a command button to open the new form, include a "close
form" command as a secondary command on the referring button's macro.
-Good luck
 
The statement you are looking for is: Docmd.Close

Sample Syntax:

1) Docmd.Close ObjectType:=acForm, ObjectName:=Me.Name

or

2) Docmd.Close acForm, Me.Name

Me.Name is the active form.. or you can specify the form name in quotes,
like this:
Docmd.Close acForm, "Form1"

HTH
--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top