Creating a button in a form that will open another and close itsel

D

DaveC271

Hi can somebody tell me how I can create a button in a form that will open
another and close the form in which the button was pressed. Similar to the
reguler next screen button you find in most software?
 
P

Phil

Simply create a form using form wizard
1) select button from toolbar
2) You will be able view command as openform
3) select form that need to be opened

However, while view code:
Be sure insert DoCmd.Close before DoCmd.OpenForm

That will close main form and will open other form.

I'm still not sure why would do that.
Most program's preferences is to keep main form open.

Anyways I hope that help!
Phil
 
F

fredg

Hi can somebody tell me how I can create a button in a form that will open
another and close the form in which the button was pressed. Similar to the
reguler next screen button you find in most software?

After you add a command button to the form, code it's click event:
DoCmd.OpenForm "OtherFormName"
DoCmd.Close acForm, Me.Name
 
Top