Find Records in Table

G

Guest

I want to find records in a table. Unfortunately, the field in the table is
upto 100 digits long and I need to return anything with values in these 100
digits. i.e. if I want to find something with 'Other' in the field, this
could be at the beginning of the field, middle or end.

Hence just putting 'Other' as the criteria, doesn't work...
 
M

Marshall Barton

Andy said:
I want to find records in a table. Unfortunately, the field in the table is
upto 100 digits long and I need to return anything with values in these 100
digits. i.e. if I want to find something with 'Other' in the field, this
could be at the beginning of the field, middle or end.

Hence just putting 'Other' as the criteria, doesn't work...


Set the criteria to:

Like "*Other*"
 
G

Guest

Works great thanks. Second part is to use a command button in a form for this
to run (I'm fine with this), but is there anyway I can have a Dialog/Search
box for the user to enter 'Other' into and the *s are inserted around for
this to work as the query does?

Thanks
 
M

Marshall Barton

Rather than a dialog box, just add an unbound text box
(let's name it txtSearch) to the form (near the button) for
users to enter what they want to use in the criteria. The
query's criteria woulkd then be:
Like "*" & Forms!nameofform.txtSearch & "*"

If you really want to use a dialog type box instead, the
criteria would be something like:
Like "*" & [Enter search text] & "*"
 

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

Top