G Guest Dec 15, 2004 #1 Hallo people How can I validate within a macro or vba if a specific form is currently open? Tnx, Eyal
Hallo people How can I validate within a macro or vba if a specific form is currently open? Tnx, Eyal
J Jesse Aviles Dec 15, 2004 #2 In Northwind, there is a function called IsLoaded in which you pass the form name as a parameter and it returns a yes/no answer.
In Northwind, there is a function called IsLoaded in which you pass the form name as a parameter and it returns a yes/no answer.
F fredg Dec 15, 2004 #3 Hallo people How can I validate within a macro or vba if a specific form is currently open? Tnx, Eyal Click to expand... What version of Access? Access 2002: If Not CurrentProject.AllForms("FormA").IsLoaded Then Do something here Else Do something else End If In Access 97, copy this function (from the Northwind.mdb sample database) to a Module. Function IsLoaded(ByVal strFormName As String) As Integer ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0 If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then If Forms(strFormName).CurrentView <> conDesignView Then IsLoaded = True End If End If End Function Then code: If Not IsLoaded("FormA") Then Do this Else Do that End if
Hallo people How can I validate within a macro or vba if a specific form is currently open? Tnx, Eyal Click to expand... What version of Access? Access 2002: If Not CurrentProject.AllForms("FormA").IsLoaded Then Do something here Else Do something else End If In Access 97, copy this function (from the Northwind.mdb sample database) to a Module. Function IsLoaded(ByVal strFormName As String) As Integer ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0 If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then If Forms(strFormName).CurrentView <> conDesignView Then IsLoaded = True End If End If End Function Then code: If Not IsLoaded("FormA") Then Do this Else Do that End if