Hi,
I'm basing a query on the variables used in a form. The database contains lots of problems, say with a computer and a tick box for the apropriate component like monitor, keyboard, mouse etc. and each has several eg problem 1 has a monitor and mouse problem
My form then has what to look for tick boxes (tri-state) for each of these. I want my query to include all monitor problems when that is ticked and all monitor and mouse problems when both ticked, no monitor problems when unticked and ignore a parameter when the tick box is null (greyed out)
I have come up with:
[CODE=SQL]WHERE ((((Table1.[Monitor])=Forms![Query Form]![Monitor tick]) Or Is Null) And (((Table1.[Keyboard])=Forms![Query Form]!Keyboard tick) Or Null) And (((Table1.Mouse )=Forms![Query Form]!Mouse tick) Or Null)[/CODE]
but I cant get it to work, it either gives my all the entries in the database or sometimes a parameter query box with "Forms![Query Form]![Monitor tick]"
any help or advice would be great, thanks
I'm basing a query on the variables used in a form. The database contains lots of problems, say with a computer and a tick box for the apropriate component like monitor, keyboard, mouse etc. and each has several eg problem 1 has a monitor and mouse problem
My form then has what to look for tick boxes (tri-state) for each of these. I want my query to include all monitor problems when that is ticked and all monitor and mouse problems when both ticked, no monitor problems when unticked and ignore a parameter when the tick box is null (greyed out)
I have come up with:
[CODE=SQL]WHERE ((((Table1.[Monitor])=Forms![Query Form]![Monitor tick]) Or Is Null) And (((Table1.[Keyboard])=Forms![Query Form]!Keyboard tick) Or Null) And (((Table1.Mouse )=Forms![Query Form]!Mouse tick) Or Null)[/CODE]
but I cant get it to work, it either gives my all the entries in the database or sometimes a parameter query box with "Forms![Query Form]![Monitor tick]"
any help or advice would be great, thanks
Comment