Query between 2 tables with one-to-many relationship

G

gueser

I have a report that I generate via a query which promptme me for a value for
one field of one table. I want to generate all the entries from another
table that correspond to that one field in that main table. I get the info,
but many times over. For exampe if there are 6 entries in the second table,
I get all the info 6 times over. Any ideas on how to correct this?
 
X

XPS350

I have a report that I generate via a query which promptme me for a valuefor
one field of one table.  I want to generate all the entries from another
table that correspond to that one field in that main table.  I get the info,
but many times over.  For exampe if there are 6 entries in the second table,
I get all the info 6 times over.  Any ideas on how to correct this?

It seems to me you are not joining the tables. The query should look
like:
SELECT * FROM Table1 INNER JOIN Table2 ON Tabel1.FieldX =
Table2.FieldX;

Groeten,

Peter
http://access.xps350.com
 
R

Ron2006

It sounds to me as if it is working as expected. Think of it this way.

1) You have an employee master record that has employee name
2) You have a hours table with number of hours per day per employee.

I you create a query that says SHOW the employee name and all the
hours records for an employee. Then if you show the employee name on
the form for each record returned with the query then you will see the
employee name each time/ for each record.

Only 3 solutions I can think of:
1) Use a report to show results and group by employee name (then it
will only show once)
2) Don't show the employee name on the form.
3) Create the form with a subform with the main form showing the
employee name and the subform NOT showing the name.

Ron
 

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