Search entire table

wilson1001

Registered User.
Local time
Today, 06:50
Joined
Mar 24, 2003
Messages
17
Hello

I have created a button on a form that searches one field in a table.

If I wanted to search across all fields in the table and not just agency, how could I change this line to do so?
Or is there a simpler term that will search the entire table.


.RowSource = "Select * FROM tapes WHERE [agency] Like '*" & Me.txtfilter & "*';"

For instance if I wanted to add the fields [tape number] [format] and so on.
I've tried adding them with square brackets here, commas there but every bit of code I create causes syntax errors (I'm learning slowly!)

Thanks
Pete:D
 
You should just have added this to your other thread as it is basically an extension of what you have already.

Anyway:

.RowSource = "Select * FROM tapes WHERE ((([Agency]) Like '*" & Me.txtFilter & "*') OR ([Format]) Like '*" & Me.txtFilter & "*'));"

and so on, and so forth...
 
Thanks mile.

I inserted the code verbatim in place of my original code (was that correct?) and now the button does not work,I.E. pressing it results in no action.

If I re-insert the original code it will search just the agency field again.
 
I missed a bracket.

.RowSource = "Select * FROM tapes WHERE ((([Agency]) Like '*" & Me.txtFilter & "*') OR (([Format]) Like '*" & Me.txtFilter & "*'));"

If that results in no action, then I can't explain it. Are all of the fields you are searching on Text fields?
 
Thanks mile - That's it.
Would you like to come and live on top of my computer and fix all my database problems? Cheers again.
Regards
Pete
 
Sorry, my work has me chained to the computer I'm using.
 

Users who are viewing this thread

Back
Top Bottom