How to Combine Vendor Conditions in an Access Inspection Query
Question details
The user needs to create an Access report that includes projects where either Vendor 1 or Vendor 2 has both Ordered and Delivered statuses set to True, while the overall Inspected status remains False.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Combining multiple vendor criteria into a single query to generate a unified project inspection report.
- Observed behavior
- Currently using separate queries and reports for Vendor 1 and Vendor 2, the user wants to evaluate both sets of conditions in one consolidated query without logical conflicts.
Ensure you have a backup of your Access database before modifying query structures, and familiarize yourself with the Query Design Grid and SQL View.
Use Boolean Logic with Proper Parentheses
Use logical AND/OR operators with correct grouping in the query criteria to evaluate both vendors simultaneously.
When dealing with multiple conditions across different vendors, proper parenthesis placement is critical. Without parentheses, Microsoft Access may evaluate the AND and OR conditions in the wrong order, returning incorrect inspection records.
Open your Access database, navigate to the 'Create' tab, and click on 'Query Design'. Add the table containing your vendor and inspection fields.
Right-click the query tab and select 'SQL View' to manually input the logical expression.
Modify your WHERE clause to group the vendor conditions and append the inspection check: WHERE (((OrderedV1=True) AND (DeliveredV1=True)) OR ((OrderedV2=True) AND (DeliveredV2=True))) AND (Inspected=False).
If using the visual Design Grid, place Vendor 1's True criteria on the 'Criteria' row, place Vendor 2's True criteria on the 'Or' row below it, and ensure Inspected=False is entered on both rows.
Click 'Run' on the Ribbon to execute the query. Verify that the consolidated report correctly filters projects based on both vendors' statuses.

Normalize the Database Structure
Restructure your tables to eliminate repeating groups (Vendor1, Vendor2), making future queries much simpler and more scalable.
Write a Custom VBA Function
Create a custom Boolean function in VBA to handle complex criteria if standard SQL becomes too complicated.
Use WPS Office for Your Data Analysis and Reporting Needs
While Microsoft Access manages relational databases, WPS Spreadsheet offers powerful data filtering, logical functions (AND/OR), and pivot tables for analyzing your exported database records. Enjoy a free, lightweight, and highly compatible alternative to Microsoft Office.
- 1. Download the Software: Visit the official WPS website and download the WPS Office suite.
- 2. Install WPS Office: Follow the installation wizard to set up the lightweight application on your device.
- 3. Analyze Exported Data: Open WPS Spreadsheet to import your Access database CSV exports and apply advanced logical filters effortlessly.

Frequently Asked Questions
Why do I need parentheses when combining AND and OR in Access?
Parentheses control the order of evaluation in SQL logic. Without them, Access evaluates AND conditions before OR conditions by default, which can lead to unintended groupings and inaccurate report results.
Can I use a VBA function to evaluate complex query criteria?
Yes, when multiple Boolean expressions must be evaluated, you can write a custom VBA function containing multiple If...End If blocks. You can then call this function directly from your query design grid to return True or False.
What is a repeating group in database design?
A repeating group occurs when multiple columns in a single table store the same type of data (e.g., Vendor1, Vendor2, Vendor3). This violates the First Normal Form (1NF) of database design, making queries unnecessarily complex and harder to scale.
How do I filter records based on multiple conditions in the Design Grid?
In the Query Design Grid, place criteria that must be true at the same time on the same 'Criteria' row (AND logic). Place alternative conditions on the 'Or' rows below. Ensure that overarching criteria, like 'Inspected=False', are repeated on every utilized row.




