WHERE Clause?

G

Guest

More as a wild hope than anything, I threw this WHERE clause into a Query:

WHERE ((Group.Company_ID)=Company.Company_ID);

Needless to say nothing happens when the Query runs.

Actually the query is the RowSource for a ListBox on a SubForm onthe same
Main Form. Company.Company_ID has been arrived at by moving the pointer in a
Listbox in another subform of the same Main Form.

What should the WHERE clause say?
 
J

John Vinson

More as a wild hope than anything, I threw this WHERE clause into a Query:

WHERE ((Group.Company_ID)=Company.Company_ID);

Needless to say nothing happens when the Query runs.

Actually the query is the RowSource for a ListBox on a SubForm onthe same
Main Form. Company.Company_ID has been arrived at by moving the pointer in a
Listbox in another subform of the same Main Form.

What should the WHERE clause say?

I have no idea, since I have no way to know what you want it to do,
nor do I know anything about the structure of your tables or their
relationships.

What would you EXPECT to happen? What are you trying to accomplish
with this query?


John W. Vinson[MVP]
 
G

Guest

Actually the query is the RowSource for a ListBox on a SubForm onthe same
Main Form. Company.Company_ID has been arrived at by moving the pointer in a
Listbox in another subform of the same Main Form.

Unfortunately I am not highly skilled in Access geek speak, so I haven't yet
mastered the full vocabulary associated with this environment. That being the
case I will try to paint a picture:

The main form has three components. In order of precedence they are:

A combobox managed by a table, Products containing a text field with names
and an autoupdate numeric field with the ID. Its "After Update" Event sets
the content of...

The first subform, managed by a Query based on the table Company which
includes a Product ID numeric field in it. This relationship works fine. The
Company names display in a Listbox on the subform. When a Company name is
selected, the expectation is that it will set the contents of...

The second subform (Groups) which displays a list of items that are distinct
for the Product and the Company selected in the first two controls. This
WHERE clause is intended for use in the Query that is the RowSource for the
Groups Subform.

Hope that clears the fog just a little <g>!


--
Dave
Temping with Staffmark
in Rock Hill, SC
 

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