Query question?

G

gm

I have a table called incidents that contains a memo field called
DETAILS

I'd like to be able to prompt for a keyword that will return only
records with that keyword in the DETAILS field

For example, if I have the word "late" in the field, I want all
records with "late" in it displayed.

I can get it to work using
Like "*late*" in the criteria field but want to be able to prompt for
different words without creating a specific static query for each.

Thanks

Gary
 
D

Douglas J. Steele

Put a field on your form. For the sake of argument, let's assume that the
form is called frmLookup, and the field on the form is called txtDetails.

In your query, put Like "*" & Forms![frmLookup]![txtDetails] & "*" as the
criteria for the Details field.
 
V

Van T. Dinh

Use the Parameter Query:

....
WHERE [Details] Like "*" & [Please enter keyword:] & "*"
 
G

gm

Put a field on your form. For the sake of argument, let's assume that the
form is called frmLookup, and the field on the form is called txtDetails.

In your query, put Like "*" & Forms![frmLookup]![txtDetails] & "*" as the
criteria for the Details field.

Thanks - that worked fine

Gary
 

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