Re: SQL Syntax Error
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Thu, 5 Jul 2007 14:39:27 -0400
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
.
- Follow-Ups:
- Re: SQL Syntax Error
- From: michelleumich
- Re: SQL Syntax Error
- From: michelleumich
- Re: SQL Syntax Error
- References:
- SQL Syntax Error
- From: michelleumich
- SQL Syntax Error
- Prev by Date: SQL Syntax Error
- Next by Date: Re: SQL Syntax Error
- Previous by thread: SQL Syntax Error
- Next by thread: Re: SQL Syntax Error
- Index(es):
Relevant Pages
|