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!

A button that closes form, but opens another

Status
Not open for further replies.

Robson8112

Technical User
Sep 5, 2002
39
GB

I need to know how you can have a button on a form that closes the form that its on when clicked but opens another different form at the same time. Can anyone help??
 
Hi:
You could use a macro with two actions: "Close" and "Open Form".

Put the macro name in the On Click event in the button's property sheet.

You could also do this in VBA:

Dim stDocName As String
DoCmd.Close
stDocName = "
NameOfFormToOpen"
DoCmd.OpenForm stDocName, , , stLinkCriteria


I hope this is helpful.

Gus Brunston [glasses] An old PICKer, using Access2000.
 
Hi, me again.
The last line in the VBA code above
doesn't need the ", , , stLinkCriteria" Gus Brunston [glasses] An old PICKer, using Access2000.
 
Cheers mate, i just needed to add in the DoCmd.Close

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top