Programmatically Close a form

  • Thread starter Thread starter Hank
  • Start date Start date
H

Hank

I have a form with an onclick event. I want to close this form when I have
clicked what I want and the other form has opened. It usually covers the form
that I used to get to the new one. What would I need to write as a last
statement to close the form after the on click event has been handled???
Please help, I am really stuck with this simple thing!!
 
Hank said:
I have a form with an onclick event. I want to close this form when I have
clicked what I want and the other form has opened. It usually covers the
form
that I used to get to the new one. What would I need to write as a last
statement to close the form after the on click event has been handled???
Please help, I am really stuck with this simple thing!!


To open a new form and close the current one, the code and be as simple as:

'----- start of example code -----
Private Sub cmdOpenNewForm_Click()

DoCmd.OpenForm "YourNewForm"
DoCmd.Close acForm, Me.Name, acSaveNo

End Sub
'----- end of example code -----
 
Back
Top