B
Brad Pears
I am having a problem passing a parameter that includes an "or" clause from
a form textbox to a query...
On this form., a user can select multiple items from a list box and I want
to pass those selections to a query... What I am doing is building the
critera when the user clicks a command button like this...
txtCriteria = """" & "Criteria1" & """" & " or " & """" & "Criteria2"
When you look at the contents of txtCriteria after it has been built, you
see
"Criteria1" or "Criteria2". If I type that exact same thing into the query,
it runs perfectly. However, as soon as I change the criteria field to
reference the textbox that contains this syntax, and run it - it does not
give an error - it just returns 0 rows... ie, in the criteria field for the
query I have "forms![frmReportCriteria].[txtCriteria]".
What am I doing wrong? I have tried various incarnations of the syntax -
none seem to work....
Thanks,
Brad
a form textbox to a query...
On this form., a user can select multiple items from a list box and I want
to pass those selections to a query... What I am doing is building the
critera when the user clicks a command button like this...
txtCriteria = """" & "Criteria1" & """" & " or " & """" & "Criteria2"
When you look at the contents of txtCriteria after it has been built, you
see
"Criteria1" or "Criteria2". If I type that exact same thing into the query,
it runs perfectly. However, as soon as I change the criteria field to
reference the textbox that contains this syntax, and run it - it does not
give an error - it just returns 0 rows... ie, in the criteria field for the
query I have "forms![frmReportCriteria].[txtCriteria]".
What am I doing wrong? I have tried various incarnations of the syntax -
none seem to work....
Thanks,
Brad