Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Exit Button to Bottom of Forms and Reports

Status
Not open for further replies.

bwedmund

Technical User
Oct 29, 2000
17
US
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.

Thanks;

Barry
 
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
 
The wizard will also allow you to create a button to do this without you having to do any coding.
Mike Rohde
rohdem@marshallengines.com
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top