Re: Help with using form text box to change a query criteria
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Fri, 01 Sep 2006 11:00:23 -0500
ngl1145 wrote:
I think I need some help from some of you. I created a simple query
where it looks at the textbox in my form as it's criteria. For example in my
query, I typed "=[Forms]![Form1]![Text0]". When I click the run query button
and I enter a set value.. say "10", the query will retrieve any records that
have "10" in the column which is great. But when I put a "<10" in the
textbox and I run the query, it gives me a "You canceled the previous
operation" message box. Is there a way I can use the Form textbox to run
conditional criteria like "<10"?
No. The < needs to be in the query instead of the =
Generally, the text box can only contain a value (e.g. 10),
it can not be used to specify the comparison operator.
If you absolutely must allow users to specify the
comparison, you will need to use a different approach where
you use VBA code (probably using the BuildCriteria function)
to construct the query. Since you didn't say anything about
how the query is going to be used, I can't realistically
suggest anything more specific than that.
--
Marsh
MVP [MS Access]
.
- Follow-Ups:
- References:
- Help with using form text box to change a query criteria
- From: ngl1145
- Help with using form text box to change a query criteria
- Prev by Date: Re: Querring fields with Zeros
- Next by Date: Re: Ranking multiple Columns
- Previous by thread: Help with using form text box to change a query criteria
- Next by thread: Re: Help with using form text box to change a query criteria
- Index(es):
Loading