Re: SQL Syntax Error



What is 2007-08ScholarshipMaster? Is it a table or a query? If so, you
must reference it in the FROM clause and it probably should be joined to
tblClient.

Seond can you describe what you are attempting to do in that where clause?

IS Forms]![frmClientSearch]![txtFilterName] supposed to be
[Forms]![QueryMultiValueSearchForm]![txtFilterName]?
Is Name a text field?


PARAMETERS [Forms]![QueryMultiValueSearchForm]![txtFilterName] Long,
[Forms]![QueryMultiValueSearchForm]![txtFilterUMID] Long,
[Forms]![QueryMultiValueSearchForm]![txtProjectGrant] Long;
SELECT tblClient.*
FROM tblClient
WHERE (2007-08ScholarshipMaster.Name Like "*" &
[Forms]![???]![txtFilterName] & "*" OR
[Forms]![???]![txtFilterName] is Null)



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"michelleumich" <mahampto@xxxxxxxxx> wrote in message
news:1183659333.831969.186300@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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



.



Relevant Pages

  • Re: SQL Syntax Error
    ... Comparisons for strings need the text qualifier " or ' unlike numeric ... received a syntax error notification while trying to run. ... SELECT tblClient.* ...
    (microsoft.public.access.queries)
  • SQL Syntax Error
    ... I am creating a search Query using SQL adapted from an online ... received a syntax error notification while trying to run. ... SELECT tblClient.* ...
    (microsoft.public.access.queries)
  • Re: SQL Syntax Error
    ... received a syntax error notification while trying to run. ... Microsoft access have false error notifications sometimes? ... SELECT tblClient.* ...
    (microsoft.public.access.queries)