M
michelleumich
Hi, I am creating a search Query using SQL adapted from an online
resource. While 'translating' the code to adapt to my Database I
received a syntax error notification while trying to run. I have
searched through the parenthesis and cannot find the Error! Does
Microsoft access have false error notifications sometimes? Is this a
bug I should be aware of? Is it a problem with my code?
Here is the code:
PARAMETERS [Forms]![QueryMultiValueSearchForm]![txtFilterName] Long,
[Forms]![QueryMultiValueSearchForm]![txtFilterUMID] Long, [Forms]!
[QueryMultiValueSearchForm]![txtProjectGrant] Long;
SELECT tblClient.*
FROM tblClient
WHERE IIf (([Forms]![QueryMultiValueSearchForm]![txtFilterName] Is
Null) ,
IIf(2007-08ScholarshipMaster.Name Like "*" & [Forms]!
[frmClientSearch]![txtFilterName] & "*"))
AND (([Forms]![QueryMultiValueSearchForm]![txtFilterUMID] Is Null)
OR (2007-08ScholarshipMaster.UMID = [Forms]!
[QueryMultiValueSearchForm]![txtFilterUMID]))
AND (([Forms]![QueryMultiValueSearchForm]![txtProjectGrant] Is
Null)
OR (2007-08ScholarshipMaster.ProjectGrant = [Forms]!
[QueryMultiValueSearchForm]![txtProjectGrant]))
AND (([Forms]![QueryMultiValueSearchForm]![txtStartDate] Is Null)
OR (2007-08ScholarshipMaster.ScholarshipStart Like "*" & [Forms]!
[QueryMultiValueSearchForm]![txtStartDate] & "*"))
AND (([Forms]![QueryMultiValueSearchForm]![txtFilterName] Is Null)
OR (2007-08ScholarshipMaster.ScholarshipStart Like "*" & [Forms]!
[QueryMultiValueSearchForm]![txtStartDate] & "*"))
If anyone spots any obvious errors let me know.
Thanks,
M
resource. While 'translating' the code to adapt to my Database I
received a syntax error notification while trying to run. I have
searched through the parenthesis and cannot find the Error! Does
Microsoft access have false error notifications sometimes? Is this a
bug I should be aware of? Is it a problem with my code?
Here is the code:
PARAMETERS [Forms]![QueryMultiValueSearchForm]![txtFilterName] Long,
[Forms]![QueryMultiValueSearchForm]![txtFilterUMID] Long, [Forms]!
[QueryMultiValueSearchForm]![txtProjectGrant] Long;
SELECT tblClient.*
FROM tblClient
WHERE IIf (([Forms]![QueryMultiValueSearchForm]![txtFilterName] Is
Null) ,
IIf(2007-08ScholarshipMaster.Name Like "*" & [Forms]!
[frmClientSearch]![txtFilterName] & "*"))
AND (([Forms]![QueryMultiValueSearchForm]![txtFilterUMID] Is Null)
OR (2007-08ScholarshipMaster.UMID = [Forms]!
[QueryMultiValueSearchForm]![txtFilterUMID]))
AND (([Forms]![QueryMultiValueSearchForm]![txtProjectGrant] Is
Null)
OR (2007-08ScholarshipMaster.ProjectGrant = [Forms]!
[QueryMultiValueSearchForm]![txtProjectGrant]))
AND (([Forms]![QueryMultiValueSearchForm]![txtStartDate] Is Null)
OR (2007-08ScholarshipMaster.ScholarshipStart Like "*" & [Forms]!
[QueryMultiValueSearchForm]![txtStartDate] & "*"))
AND (([Forms]![QueryMultiValueSearchForm]![txtFilterName] Is Null)
OR (2007-08ScholarshipMaster.ScholarshipStart Like "*" & [Forms]!
[QueryMultiValueSearchForm]![txtStartDate] & "*"))
If anyone spots any obvious errors let me know.
Thanks,
M