I have been trying to find a way to put a button at the bottom of forms and reports that will let you close them and return to a main menu screen. I am not an experienced programmer, so any help is appreciated.
In design view, with the properties window open, click on the button you want to add the close to, and select the Event tab from the properties window.
Next click the elipse button on the On Click Event(...), and select code builder. Let's say your button was named cmdClose, then you should see this:
=====
Private Sub cmdClose_Click()
End Sub
=====
Now make it look like this:
=====
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
=====
Close and save the form. Jim Lunde
compugeeks@hotmail.com
Custom Application Development
Previous thread correct but don't forget to add DoCmd.Open acForm, "frmMyMainMenu" to open the main menu form. Use whatever formname you have assigned to your main form.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.