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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make 1 button close the current form and open a new one?

Status
Not open for further replies.

Blitz

Technical User
Jul 7, 2000
171
US
Im trying to make one button in a form open a new table and close the current one. Is there any easy way to do this? This is my first attempt at making an access database and I dont know visual basic :( Thanks for any help.
 
Attach this code to the button:<br><br>Private Sub btn_OpenNewForm_Click()<br>Dim linkCriteria As String<br><br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenForm yourformname, , , linkCriteria<br><br>End Sub<br><br>The first DoCmd closes your current form and the second one opens the form you name in the 'yourformname' variable.<br><br>shar<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top