form checking to see if another form is open

swmorin

Registered User.
Local time
Today, 17:51
Joined
Jan 10, 2012
Messages
66
I have one form that is capable of being opend from two locations.

First- there is a button to add an instructor appt

Second- there is a link in the instructor profile page

I only want to have one add new form. The easiest way for me to do this is if the individual clicks the add new link in the instructor profile the instructor combo box automatically selects the instructor the individual is looking at in the instructor profile screen.

I tried this which did not work. Is there a way to do this

Code:
If [Forms]![frm_instructor_profile].Open = True Then
 
This function will = 0 if the form is closed, 1 if it is open.
Code:
syscmd(acSysCmdGetObjectState,acForm,"FormName")
 
Air code...

Code:
  Dim frm As Access.Form
  Dim strFindForm As String

  strFindForm = "thesearchedforformname"

    For Each frm In Forms
      If frm.Name = strFindForm  Then
        'Yup, it was open!
        'So do something...
        Exit For
      End If
    Next frm
 
DJkari that worked perfectly thanks a lot!!!
 

Users who are viewing this thread

Back
Top Bottom