Requery - three level form

D

Dave Birley

Main form has a Combobox which is behaving the way I expect it to. (Finally
<g>). The Combobox deals with Product_Family which is the name of a table and
also the text field in that table. The ID field is Product_ID.

Each Product Family may not necessarily relate to every Company in the
Company table, so the Company Table (shich has its own sub-form on the main
form) has a Product_ID field with which to link to the Product Family.

There is more stuff going on further downstream, where the second Subform,
which should behave as a child of the Company subform, actually behaves as a
child of the Combobox.

The Query for the Company subform is a SELECT DISTINCT so that only one of
each Company [is supposed to] display. Here's its code:

SELECT DISTINCT Company.Company
FROM Product_Family INNER JOIN Company ON
Product_Family.Product_ID=Company.Product_ID
WHERE (((Company.Product_ID)=Me!cboProductFamily.Product_ID))
ORDER BY Company.Company;

What I am getting is a display of all the names in teh Company Table with no
DISTINCT involved, and no reaction to changes in the combo box. Meanwhile
the third level sub form happily changes when I change an item in the Combo
box, but also totally ignores the Company sub form.

Relationships are set appropriately between the tables.

Can you spot anything in here that could explain the behavior, and what i
should try? If you suggest some code -- please also tell me where to put it
(be polite now <g>) -- I am an ancient xBase/VFP programmer who is struggling
to survive through this Access assignment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top