Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
When you're writing an Or query with multiple values, sometimes using 'In' is better than using 'Or.' You can use the In operator when you need to determine whether a value equals one of many values. Let's look at our In-state query in Design View. I'll hold my cursor between the State and Work Phone columns, so I get a double headed arrow, and I'll double-click to spread it out. So here I'm looking for customers from within a set of states and this expression uses a series of Or operators.
California Or Nevada Or New Mexico Or Arizona Or Maryland Or Pennsylvania. A simpler alternative is to use the In operator. In parenthesis, California, Nevada New Mexico, Arizona Maryland Pennsylvania, and then I'll finish it off with my closing parenthesis but when I hit Tab, notice that I didn't even have to type in the quotation marks myself. Access put them in for me. See how much shorter an In statement is than an Or statement, and when I delete the Or statement and run the query again, it gives me the exact same result.
This syntax can also be used with validation rules, SQL statements and Macros anywhere you write code. When you want to check to see if a field is within a specific dataset, an In statement is a nice alternative to lengthy Or statements.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98185 Viewers
80 Video lessons · 141372 Viewers
59 Video lessons · 59714 Viewers
52 Video lessons · 72938 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.