IsLoaded condition in a macro

  • Thread starter Thread starter Kathy Webster
  • Start date Start date
K

Kathy Webster

How can I use IsLoaded in the condition column of a macro?
I tried IsLoaded([forms!]![frmCalendar])
I tried IsLoaded([frmCalendar])
No luck.

TIA,
Kathy
 
Kathy,

What is "IsLoaded"? If it is a custom (user-defined) function in your
application, you will need to look at the code the function uses. One
possibility isd that it takes the name of the form as a String variable,
in which case this might work in the macro condition:
IsLoaded("frmCalendar")
 
Steve,
I'm trying to determine in the macro condition if a particular form is open
or not. It does not have to be the active form on top, but perhaps open and
behind another form.
Kathy

Steve Schapel said:
Kathy,

What is "IsLoaded"? If it is a custom (user-defined) function in your
application, you will need to look at the code the function uses. One
possibility isd that it takes the name of the form as a String variable,
in which case this might work in the macro condition:
IsLoaded("frmCalendar")

--
Steve Schapel, Microsoft Access MVP

Kathy said:
How can I use IsLoaded in the condition column of a macro?
I tried IsLoaded([forms!]![frmCalendar])
I tried IsLoaded([frmCalendar])
No luck.

TIA,
Kathy
 
Kathy,

I have seen a function called IsLoaded() which can be used for this purpose.

The following code would need to be written to a standard module:
_____________

Public Function IsLoaded(strFrmName As String) As Boolean

Const conFormDesign = 0
Dim intX As Integer
IsLoaded = False

For intX = 0 To Forms.Count - 1
If Forms(intX).FormName = strFrmName Then
If Forms(intX).CurrentView <> conFormDesign Then
IsLoaded = True
Exit Function
End If
End If
Next

End Function
_____________

.... but that assumes you don't already have an IsLoaded function in your
application, which is really what I was asking about.
 
THanks STeve.

Steve Schapel said:
Kathy,

I have seen a function called IsLoaded() which can be used for this
purpose.

The following code would need to be written to a standard module:
_____________

Public Function IsLoaded(strFrmName As String) As Boolean

Const conFormDesign = 0
Dim intX As Integer
IsLoaded = False

For intX = 0 To Forms.Count - 1
If Forms(intX).FormName = strFrmName Then
If Forms(intX).CurrentView <> conFormDesign Then
IsLoaded = True
Exit Function
End If
End If
Next

End Function
_____________

... but that assumes you don't already have an IsLoaded function in your
application, which is really what I was asking about.
 
Kathy,
IsLoaded can be found in the Northwinds sample database Utilies module. To
use this function in any of your applications, Import the module into your
database (please don't copy/paste, it'll screw up the JET engine). Then you
can call the procedure in a macro by setting the condition to: IsLoaded
("frmYourFormName"). This vb function works on a string value, so don't
forget the quotation marks on either side of the form name otherwise you'll
get an unable to parse error message and the macro will fail.


Kathy said:
Steve,
I'm trying to determine in the macro condition if a particular form is open
or not. It does not have to be the active form on top, but perhaps open and
behind another form.
Kathy
[quoted text clipped - 11 lines]
 
Back
Top