Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompt query 1

Status
Not open for further replies.

Arob

Technical User
Jul 25, 2001
55
US
I have a query that I'm wanting to run off a form. Users enter in the criteria into several form feilds. I used the below expression, only with different form feild names. Expr1: IIf(IsNull([Forms]![frmbamatrix]![causeofloss1]),&quot;&quot;,[tblbapmatrix]![Covgdetail]=[Forms]![frmbamatrix]![causeofloss1]), The criteria is <>False. I want the query to run as an OR statement. If I enter two criteria it searches for both. However if I only want to enter one peice of criteria it will only look for the one. I am having problems getting it to look for only one item. Any assistance would be great. Thanks
 

Set up your query this way.
[tt]
Field name: Covgdetail
Table: tblbapmatrix
Sort:
Show: Yes
Criteria: [Forms]![frmbamatrix]![causeofloss1]
[Forms]![frmbamatrix]![causeofloss2]
[Forms]![frmbamatrix]![causeofloss3]
[/tt]
In the SQL view the query would look like this.

SELECT colA, colB, Covgdetail, ....
FROM tblbapmatrix
WHERE tblbapmatrix.Covgdetail=[Forms]![frmbamatrix]![causeofloss1]
OR tblbapmatrix.Covgdetail=[Forms]![frmbamatrix]![causeofloss2]
OR tblbapmatrix.Covgdetail=[Forms]![frmbamatrix]![causeofloss3];
Terry Broadbent

&quot;The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge.&quot; - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top