Docmd.Close closes Access ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I placed a command button on a form to close the form. When it is clicked
Access closes instead of just the form. Any ideas why?
Thanks
 
I placed a command button on a form to close the form. When it is clicked
Access closes instead of just the form. Any ideas why?
Thanks

I'd suggest explicitly closing the form object:

Public Sub cmdClose_Click()
DoCmd.Close acForm, Me.Name
End Sub

This uses me.name so that the same code can be used on any form.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top