If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
IsLoaded
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? |
#2
|
|||
|
|||
IsLoaded
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],"")) -- HTH Van T. Dinh MVP (Access) "Maureen" wrote in message ... 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? |
Thread Tools | |
Display Modes | |
|
|