Prompting for same result in multiple fields.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I prompt for the same result in multiple fields. This will have to
include a partial ie. Like ("*" & [Enter Item] & "*"). I can get this pull
up the proper results in one field but it's not searching all even when I
include this in the criteria under each field I am wanting to search.
 
Are you putting the criteria on separate lines so that you are searching to
see if the value exists in field1 OR in field2 OR in field3? If you put the
criteria all in one line then the value would have to exist in every single
one of the fields you were searching.
 
Frustrated_with_Access said:
How can I prompt for the same result in multiple fields. This will have to
include a partial ie. Like ("*" & [Enter Item] & "*"). I can get this pull
up the proper results in one field but it's not searching all even when I
include this in the criteria under each field I am wanting to search.


Put that criteria under each of the fields, but ON DIFFERENT
criteria rows.
 
Marshall Barton said:
Frustrated_with_Access said:
How can I prompt for the same result in multiple fields. This will have to
include a partial ie. Like ("*" & [Enter Item] & "*"). I can get this pull
up the proper results in one field but it's not searching all even when I
include this in the criteria under each field I am wanting to search.


Put that criteria under each of the fields, but ON DIFFERENT
criteria rows.

Under Item1 criteria I have Like ("*" & [Enter Item] & "*"), I also have
this criteria on the other fields I am wanting to search in the next criteria
row down, the or row, and I am still only getting results if the item is
listed in the first field.
 
Frustrated_with_Access said:
How can I prompt for the same result in multiple fields. This will have to
include a partial ie. Like ("*" & [Enter Item] & "*"). I can get this pull
up the proper results in one field but it's not searching all even when I
include this in the criteria under each field I am wanting to search.
Marshall Barton said:
Put that criteria under each of the fields, but ON DIFFERENT
criteria rows.
Frustrated_with_Access said:
Under Item1 criteria I have Like ("*" & [Enter Item] & "*"), I also have
this criteria on the other fields I am wanting to search in the next criteria
row down, the or row, and I am still only getting results if the item is
listed in the first field.


Every field must have its criteria on a separate "or" line.

The resulting SQL Where clause will be like:

WHERE fa Like "*" & [Enter Item] & "*" OR fb Like "*" &
[Enter Item] & "*" OR fc Like "*" & [Enter Item] & "*"
OR . . .

To see what you are getting, switch the query to SQL View.
There will probably be a lot of extra parenthesis, but son't
be concerned with them, Just make there are no ANDs instead
of the ORs.
 
Marshall Barton said:
Frustrated_with_Access wrote:
How can I prompt for the same result in multiple fields. This will have to
include a partial ie. Like ("*" & [Enter Item] & "*"). I can get this pull
up the proper results in one field but it's not searching all even when I
include this in the criteria under each field I am wanting to search.
Marshall Barton said:
Put that criteria under each of the fields, but ON DIFFERENT
criteria rows.
Frustrated_with_Access said:
Under Item1 criteria I have Like ("*" & [Enter Item] & "*"), I also have
this criteria on the other fields I am wanting to search in the next criteria
row down, the or row, and I am still only getting results if the item is
listed in the first field.


Every field must have its criteria on a separate "or" line.

The resulting SQL Where clause will be like:

WHERE fa Like "*" & [Enter Item] & "*" OR fb Like "*" &
[Enter Item] & "*" OR fc Like "*" & [Enter Item] & "*"
OR . . .

To see what you are getting, switch the query to SQL View.
There will probably be a lot of extra parenthesis, but son't
be concerned with them, Just make there are no ANDs instead
of the ORs.

Thank you this really helped me a lot!!
Karen
 

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

Back
Top