Hello,
I need some help with a query I'm writing. I've read up on union and sub queries but have not figured my problem out as of yet. I am not even sure I can do this in the criteria definition.
I have a table that contains several columns (fields) that represent features of a part. Let me use a house for an example.
Database name: Houses
Type Paint Windows Levels Remarks
Ranch white 8 1 Small yard
CapeCod blue 10 2 2 acres
Colonial white 12 3 1/4 acre
Country white 6 2 1/2 acre
The form used to drive the query has combo boxes to limit the selection for fields: Type, Paint, Windows, Levels. It also has a text box for addition comments (ie "Remarks". What I want to do is be able to search on one or more of these fields. For instance, if I want to search on Paint and Levels those are the only two fields on the form that will have a value - the rest will be null.
So if my form values are cboPaint = white, and cboLevels = 3, then the query should find....
Type Paint Windows Levels Remarks
Colonial white 12 3 1/4 acre
Likewise if I want to search on the Remark field with txtRemark = "1/2", then it should return...
Type Paint Windows Levels Remarks
Country white 6 2 1/2 acre
Can I do this in the criteria line or do I need to write a VBA Module? Does anyone have any suggestions of how to code this?
The ultimate end product of all this work will be to develop an engineering database to search 15,000 different parts. So any help would be greatly appreciated.
Thanks!
I need some help with a query I'm writing. I've read up on union and sub queries but have not figured my problem out as of yet. I am not even sure I can do this in the criteria definition.
I have a table that contains several columns (fields) that represent features of a part. Let me use a house for an example.
Database name: Houses
Type Paint Windows Levels Remarks
Ranch white 8 1 Small yard
CapeCod blue 10 2 2 acres
Colonial white 12 3 1/4 acre
Country white 6 2 1/2 acre
The form used to drive the query has combo boxes to limit the selection for fields: Type, Paint, Windows, Levels. It also has a text box for addition comments (ie "Remarks". What I want to do is be able to search on one or more of these fields. For instance, if I want to search on Paint and Levels those are the only two fields on the form that will have a value - the rest will be null.
So if my form values are cboPaint = white, and cboLevels = 3, then the query should find....
Type Paint Windows Levels Remarks
Colonial white 12 3 1/4 acre
Likewise if I want to search on the Remark field with txtRemark = "1/2", then it should return...
Type Paint Windows Levels Remarks
Country white 6 2 1/2 acre
Can I do this in the criteria line or do I need to write a VBA Module? Does anyone have any suggestions of how to code this?
The ultimate end product of all this work will be to develop an engineering database to search 15,000 different parts. So any help would be greatly appreciated.
Thanks!