Form Check

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good morning
I'd like to execute an OnClick event that will skip/run different steps depending on if the user (I'm using the fOSUserName() api) has the switchboard form open (frmLogin). I've dug through the help files and cannot find anything. I was actually thinking that one of the system objects would change a value if a particular object was open, but I couldn't find anything in the system files either

Can someone please help me out with the right statements

Thank you
Derek
 
There's an IsLoaded() function in the NorthWind.mdb
database that I use a lot. It returns True if the form
specified by the parameter is open in Form view or
Datasheet view.

eg) If IsLoaded("frmLogin") Then MsgBox "Found It"

Function IsLoaded(ByVal strFormName As String) As Boolean
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
-----Original Message-----
Good morning,
I'd like to execute an OnClick event that will skip/run
different steps depending on if the user (I'm using the
fOSUserName() api) has the switchboard form open
(frmLogin). I've dug through the help files and cannot
find anything. I was actually thinking that one of the
system objects would change a value if a particular object
was open, but I couldn't find anything in the system files
either.
 
Cool. Thanks, Elwin.

Dere

----- Elwin wrote: ----

There's an IsLoaded() function in the NorthWind.mdb
database that I use a lot. It returns True if the form
specified by the parameter is open in Form view or
Datasheet view

eg) If IsLoaded("frmLogin") Then MsgBox "Found It

Function IsLoaded(ByVal strFormName As String) As Boolea
Const conObjStateClosed =
Const conDesignView =
If SysCmd(acSysCmdGetObjectState, acForm,
strFormName) <> conObjStateClosed The
If Forms(strFormName).CurrentView <> conDesignView The
IsLoaded = Tru
End I
End I
End Functio
-----Original Message----
Good morning
I'd like to execute an OnClick event that will skip/run
different steps depending on if the user (I'm using the
fOSUserName() api) has the switchboard form open
(frmLogin). I've dug through the help files and cannot
find anything. I was actually thinking that one of the
system objects would change a value if a particular object
was open, but I couldn't find anything in the system files
either
 
Back
Top