Closing forms

  • Thread starter Thread starter Derek Brown
  • Start date Start date
D

Derek Brown

Hi All

How do I close a form using a command button on another form only if the
form is open. When I click the button on the form to close the other form
when it's not open I get an error.

Any ideas?
 
Assuming Access 2000 or later:

Dim strForm As String
strForm = "NameOfYourOtherFormHere"
If CurrentProject.AllForms(strForm).IsLoaded Then
DoCmd.Close acForm, strForm
End If
 
Thanks Allen!! Straight to the point!

Would you beleieve I have a brother Named Alan Brown
 

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