Passing Operators from Form to Query Criteria

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi Folks - Is there a way to pass operators such as >=, <=, <>, like ,etc.
from a form into a query's criteria row?

Thanks,

Michael
 
From all I have read you can not but there is a work around. Use checkbox or
options group to set criteria for calculted fields.
Give a little more details of what you are trying to do.
 
The query in design view would look like this ---
FIELD: X: [FORMS]![YOURFORM]![FRAME1] [SomeDataField]
TABLE:
SORT:
CRITERIA: 1
[FORMS]![YOURFORM]![TEXT1]
2
<=[FORMS]![YOURFORM]![TEXT1]
3
<>[FORMS]![YOURFORM]![TEXT1]
 
Here's the example:

I have an option group with 3 choices: Open, Not Open, All. When
I choose Open, I update an hidden text box with the word "open". That
textbox value is passed to a query field's criteria. That field contains
values such as Open, Pending, Closed, N/A. No problem so far.

However, when I choose Not Open in the option group choices, I want to be
able to pass the criteria <>"open" to the query. What's the best way to
handle this? Make sense?





KARL DEWEY said:
The query in design view would look like this ---
FIELD: X: [FORMS]![YOURFORM]![FRAME1] [SomeDataField]
TABLE:
SORT:
CRITERIA: 1
[FORMS]![YOURFORM]![TEXT1]
2
<=[FORMS]![YOURFORM]![TEXT1]
3
<>[FORMS]![YOURFORM]![TEXT1]


KARL DEWEY said:
From all I have read you can not but there is a work around. Use
checkbox or
options group to set criteria for calculted fields.
Give a little more details of what you are trying to do.
 
As I said in design view of your query add a new field like this --
X: [FORMS]![YOURFORM]![FRAME1]
In the criteria row enter the option group value that represents Not Open.
In the same row under your status enter <>"open" so that when you select
Not Open it will work.

Michael said:
Here's the example:

I have an option group with 3 choices: Open, Not Open, All. When
I choose Open, I update an hidden text box with the word "open". That
textbox value is passed to a query field's criteria. That field contains
values such as Open, Pending, Closed, N/A. No problem so far.

However, when I choose Not Open in the option group choices, I want to be
able to pass the criteria <>"open" to the query. What's the best way to
handle this? Make sense?





KARL DEWEY said:
The query in design view would look like this ---
FIELD: X: [FORMS]![YOURFORM]![FRAME1] [SomeDataField]
TABLE:
SORT:
CRITERIA: 1
[FORMS]![YOURFORM]![TEXT1]
2
<=[FORMS]![YOURFORM]![TEXT1]
3
<>[FORMS]![YOURFORM]![TEXT1]


KARL DEWEY said:
From all I have read you can not but there is a work around. Use
checkbox or
options group to set criteria for calculted fields.
Give a little more details of what you are trying to do.

:

Hi Folks - Is there a way to pass operators such as >=, <=, <>, like
,etc.
from a form into a query's criteria row?

Thanks,

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top