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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Need to place criteria in a query via a text box on a form 1

Status
Not open for further replies.

proflola

IS-IT--Management
Jul 29, 2000
62
0
0
US
I'm working on a search form that has several unbound controls that populate the criteria on a query. This query will then be the basis for a report.

I some checkboxes that place data in an unbound control named "txtSection" via the On-Focus Event on a form. In the query under the specific field, I have an expression that points to the unbound control. Everything works until I try to do "ALL" with a wildcard "*". It used to work with the On-focus event for the "ALL" checkbox written as:

txtSection = "*"

I have an old database that it works fine in. Any clues to what's happening or how to get the unbound control on the form to place the criteria in the query so that it will show all the records.

I know that I'm missing something simple, but for the life of me, I can't seem to figure it out today. I hope someone out there can help.

Thanks!
Sandy
 
Code:
It used to work with the On-focus event for the "ALL" checkbox written as:
txtSection = "*"

If your query is similar to
Code:
... ((yourtable.yourfield) [COLOR=red][b]=[/b][/color] [Forms]![formname]![txtSection].[Value]) ...
try changing it to
Code:
... ((yourtable.yourfield) [b]like[/b] [Forms]![formname]![txtSection].[Value]) ...

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Hi Traingamer,

Thanks for your fast reply. I was sure it would work, but unfortunately it didn't. Here's the query criteria I used:

Like [Forms]![CaseFrm]![txtSection]

In the Control [TxtSection] on the form, I have the value * showing after I made the GotFocus--TxtSection="*".

I actually started it from scratch..just in case I had something that shouldn't be there, but still no luck. I am stumped!
 
Hooray!

It finally worked. I forgot about that I had a start date and end date that was affecting the data, too.

Boy, I must be out of it today!

Thanks again!

Sandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top