Docmd.Close closes Access ?

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
 
J

John Vinson

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
 

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

Top