closing a form after clicking a cmd button...fairly simple

  • Thread starter Thread starter andrew v via AccessMonster.com
  • Start date Start date
A

andrew v via AccessMonster.com

pretty novice to the VB side of it. but, how do i close the current form
once i've clicked on a button to go to a new form?

thanks...
 
Something like so:

Private Sub cmdOpenCloseForms_Click()
DoCmd.OpenForm "NameOfOtherFormHere"
DoCmd.Close acForm, "NameOfThisFormHere"
End Sub

For the second line you could also use Me.Name for the
current form, but I prefer to specifically tell Access what
object I want to close.
 
Back
Top