Query Form Combo Question

  • Thread starter Thread starter RobVT
  • Start date Start date
R

RobVT

Hey all!
Using MS Access 2000.

I have a simple form I'm using to perform an Inner Join query on two
tables. To poulate the query, I'm using a series of combo boxes and
text boxes.

To keep it simple, I'll use the most basic example. I have an
Operation Type combo box and a Date text box. If I limit the query to
just look for and return the value from the combo box, it does fine.
However, when I add an "AND" statement to also look for the Date, the
query does not limit data return to the Operation Type selected. The
Date is returned fine (returning only records from only the date
inserted). I've included an "Or [Date Taken] Is Null" to accomodate
the possibility that the user may not want to specify a date, but I
don't think that is the problem.

The only possibility I can imagine arises from the fact that the Date
and Operation Type data fields are stored in separate tables. These
tables are joined by an identification number. I didn't think that
would matter however.

Any and all suggestions are welcomed. I've been struggling with this
thing all weekend.

Thanks in advance.

Rob
 
Rob, just to get the terminology right: forms do not perform joins, and
combo boxes do not populate queries. /Queries/ perform joins, /tables/
populate queries, and combo boxes can /filter the result of/ a query.

My suggestion: forget about the form completely for the moment. Show us
the fields in each of the tables involved in the query. (We only need
their names at this stage. Do not bother with their types & lengths.)
In particular, show us what are the primary key field(s) of each table.

Note: *No SQL* yet! There's no point even looking at the query SQL,
until your table structures have been reviewed & checked correct -
particularly the primary keys.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
Back
Top