IsLoaded

  • Thread starter Thread starter Maureen
  • Start date Start date
M

Maureen

I have copied the IsLoaded module from the Northwind DB
into my own DB. I have successfully used this code in a
macro condition.

Can I use the IsLoaded function within the criteria of a
query?

I am trying to set the criteria of a query to equal a
certain field of another open form -depending on which of
two forms will be open. The expression is accepted (so
no typos in creating the expression syntax) but when I
try to run the query I get a message that the ISLOADED
function is not recognized.

My criteria in the query is as follows:

=IIf(IsLoaded([Forms]![tblInquiry1]),[Forms]!
[tblInquiry1]![CompanyID],IIf(IsLoaded([Forms]![Company
and Contacts]),[Forms]![Company and Contacts]!
[CompanyID]," "))


Can you help me?
 
Yes but you need to pass to it simply the Form name as a String rather than
the Form object.

Try:

=IIf(IsLoaded("[tblInquiry1]"),[Forms]![tblInquiry1]![CompanyID],
IIf(IsLoaded("[Company and Contacts]"),
[Forms]![Company and Contacts]![CompanyID],""))
 
Back
Top