Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If...Then 2 conditions (a2003)

    On closing a form I need to execute a set of instructions if neither of two forms is open. Is there an IF...Else...Else structure or an If Not IsOpen ('form1') Or ("form2") Then structure?

    E

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: If...Then 2 conditions (a2003)

    You can use the IsLoaded property to test if an Access object is open:

    If CurrentProject.AllForms("Form1").IsLoaded = False And _
    CurrentProject.AllForms("Form2").IsLoaded = False Then
    ...
    End If

    alternatively:

    If Not (CurrentProject.AllForms("Form1").IsLoaded Or _
    CurrentProject.AllForms("Form2").IsLoaded) Then
    ...
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •