close current form while opening another simultaneously

  • Thread starter make a VBA to export pivot chart to word
  • Start date
M

make a VBA to export pivot chart to word

how do i create a macro or what buttons do i need to click so that when i
open a form that has a macro that when clicked opens another form the current
form is closed while simultaneously opening the new form?
 
J

John Vinson

how do i create a macro or what buttons do i need to click so that when i
open a form that has a macro that when clicked opens another form the current
form is closed while simultaneously opening the new form?

Well, a computer can only do one thing at a time... <g>

I'd use VBA code. In the button's Click event, select the ... icon;
invoke the Code Builder; and edit the code to something like

Private Sub buttonname_Click()
DoCmd.OpenForm "NewFormName"
DoCmd.Close acForm, Me.Name
End Sub


John W. Vinson[MVP]
 
Top