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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top