Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Criteria set by Form Text Box

Status
Not open for further replies.

jennilein

Technical User
Mar 17, 2003
63
US
I've used drop down lists in forms to set criteria for queries and text boxes too - however - in this one case it's not working.

Normally, I have a set value or use "*" to run the query. This time I would like the text box for entering "*" or a >=0 statement. It works with the "*" - but it doesn't seem to like the ">=". Is it possible to use a text box on a form to enter these types of query criteria??

Thanks a bunch!
 
Hi,

How are you USING the textbox WITH your query criteria? Post your code.

Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
How and where is your criteria built/retrieved ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I'm using a form to set the criteria in a query which opens a report.

I've tried these two options:
Like [Forms]![frm_impactsim]![txt_negnetqty] & "*"

and
[Forms]![frm_impactsim]![txt_negnetqty]

There are really only two criteria options * or >=0

does this help clarify?
 
Some inconsistency here: Like * is for text, >=0 is for numeric.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The field is numeric - containing both negative and positive numbers. I would like to use the text box to set criteria to include either all records or only those with a positive quantity.

Do you have any suggestions? Is this possible to do with a text box?
 
the LIKE operator goea AFTER the fieldname
[tt]
[Forms]![frm_impactsim]![txt_negnetqty] & " Like " & "A*"
[Forms]![frm_impactsim]![txt_negnetqty] & " >= '" & "somevalue" & "'"
[/tt]
usually these are in a textbox
[tt]
[Forms]![frm_impactsim]![txt_negnetqty] & " Like " & textbox1.text
[/tt]
where textbox1.text = "A*"

Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
something like this ?
WHERE ... ([Forms]![frm_impactsim]![txt_negnetqty]="*" OR [field name]>=0) ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top