Hey, thanks a ton for your help. Month does mean the actual month name.
However when I enter the syntax in to the query criteria... I keep
getting
an
error message that says "The syntax of the subquery in this expression
is
incorrect". "Check the subquery's syntax and enclose the subquery in
parentheses"
But when I use parenthesis it says file can't be found. Any clue?
Thanks
:
If [Month of Incident] contains the month, spelled out in letters, you
need
quotes around the values for which you're checking:
Select * FROM tblMasterlist.[Month of Incident] WHERE [Month of
Incident]="January" OR [Month of Incident]="March"
Alternatively, you could use
Select * FROM tblMasterlist.[Month of Incident] WHERE [Month of
Incident]
In
("January", "March")
If [Month of Incident] contains something else, what does it contain?
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Hey Douglas,
Thanks for the help. However I plugged in the code, attached it to a
Text
Box, so now my parameter looks like
Select * FROM tblMasterlist.[Month of Incident] WHERE [Month of
Incident]=January OR [Month of Incident]=March
Then in the actual query I put in the criteria
Forms!frmCreateReport.cTest.Value
cTest is the textbox with the above value.
However the query comes up blank. Any ideas?
:
Once the MultiSelect property is set to other than None, you can't
refer
to
list boxes in that way in queries. Since your intent is to allow
multiselection, you may as well do it properly now, which means
building
up
the Where clause in VBA, and changing the SQL associated with the
query.
See
http://www.mvps.org/access/forms/frm0007.htm at "The Access
Web"
for
an
example.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Hi, I'm having a problem running a query using a Multi Select
List
Box.
Right
now I'm just trying for one item, so my Criteria for the Year
field
looks
like this...
Forms!frmCreateReport.[crcYear].ItemData(2)
If I use the Immediate Window and write this in, it gives me the
answer
of
2005... which is what I would like the query to use for it's
query.
However when I input this in the query it gives me a user defined
function
error. Any one know the solution to this problem?
Thanks in advance.