By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,050 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,050 IT Pros & Developers. It's quick & easy.

Query Criteria

P: 6
Hi All,
I was wondering if it's possible to use more than one criteria for a single field in a MS Access query. My table has 4 fields

FirstName
LastName
Location
YearsService

I've created a form containing two text boxes where a user can enter 1 location (query displays results for just that location) or 2 locations (query displays results for both locations) or none (query displays all results). Can this be done ?


Thank you
1 Week Ago #1

✓ answered by cactusdata

Yes, try with:

Expand|Select|Wrap|Line Numbers
  1. Where [Location] = [Forms]![YourForm]![Location1] Or [Location] = [Forms]![YourForm]![Location2] Or [Location] = ([Forms]![YourForm]![Location1] & [Forms]![YourForm]![Location2]) Is Null

Share this Question
Share on Google+
2 Replies


P: 18
Yes, try with:

Expand|Select|Wrap|Line Numbers
  1. Where [Location] = [Forms]![YourForm]![Location1] Or [Location] = [Forms]![YourForm]![Location2] Or [Location] = ([Forms]![YourForm]![Location1] & [Forms]![YourForm]![Location2]) Is Null
1 Week Ago #2

P: 6
Wow !...perfect. Thank you for your help.
1 Week Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.