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
 
Back
Top