Form Doesn't Query Data Correctly (1 Viewer)

S

SNewsome

Guest
I created a database to capture officer activity information. I created a form (frmActivityQry), based on a query (ActivityQry) of the Main Table, that allows users to query the database for information. The user makes selections from the drop-down menus and the items selected appear on an Excel spreadsheet when they click OK. The only problem is when they select a specific district from the Districts drop-down, all districts appear on the spreadsheet.

Attached is a copy of the database.
 

Attachments

  • Activity.zip
    68.4 KB · Views: 77

boblarson

Smeghead
Local time
Today, 12:07
Joined
Jan 12, 2001
Messages
32,059
Your query is not created properly (ActivityQry).

In it, you have a bunch of OR statements. If you want to do the thing right, your form will need different queries for each possible combination of the criteria you want. You will need to use if statements to determine which items have been chosen.

One query will not cover all.
 
S

SNewsome

Guest
Can you give me an example of an if statement to use in the query? The data query form is querying everything fine right now with the existing OR statements, with the exception of the District field.

Thanks for your help.
 

Users who are viewing this thread

Top Bottom