Button question

  • Thread starter Thread starter Kim Jackson
  • Start date Start date
K

Kim Jackson

I have a button on my form and I need help with adding
code.. what I want to do is close [frmMain] and open
[frmEdits]..
thanks
 
HI!!
Go to the macro wizard, create new macro.
Inside macro, select 'Close'... and in the 'Action
arguments' section
select the object(in this case,a form) and
select 'frmMain'.
after, select in the upper section the 'OpenForm'... and
in the 'Action arguments' section choose the form name you
want to open.(frmEdits)
Save-it to whatever you want.I.e. 'closeMainFrm'.

then go into the botton properties of the desired button.
Choose the 'click-event' and select 'CloseMainFrm' from
the available drop-down list.

Hope this helps....
 
On Click Event:

DoCmd.OpenForm "frmEdits"
DoCmd.Close acForm, "frmMain", acSaveYes

acSaveYes = is optional it saves any changes to the form
without prompting
 
Back
Top