Ahh Ha! The number of records in each table is the key clue
here. 4 times 40 is 160, which clearly implies the you are
using a cross product type Join. You probably have no idea
what that is, but it is represented in the query design grid
by the lack of a line connecting the primary key field in
the DVD table and the foreign key field in the Loans table.
(This kind of query will join every record in one table to
every record in the other table.)
You can create the line by dragging the mouse from one of
those fields to the other. This will create an INNER JOIN
where only records where the two fields match are returned.
(This is also called the intersection of the two tables).
If you should want all the records from one table and any
matching records from the other table (LEFT or RIGHT JOIN),
then right click on the line to pop up a Join Properties
dialog box where you can select the type of Join you want to
use.
--
Marsh
MVP [MS Access]
Thanks for your help - in answer to your question - the database is for a
pupil I teach - it has only 4 DVDs on the tblLoan. One has been returned. I
will try to post a copy of the SQL statement.
If it helps, I have used New Query in design view. The pupil has
successfully created a query to show only those DVDs with are overdue. That
was based on tblLoan (for the date and return) and tblCustomer for the
person's name and telephone number to contact them if they had an overdue DVD.
When I tried to help her set up a query to produce a report of which DVDs
are available I hit this snag. Using tblDVD alone was fine - as soon as I
added tblLoan to the grid in design view only the four DVDs on that table
showed when I ran the query. Eventually it did run, but as I said everything
was exactly duplicated three further times, giving all the information 4
times in total. I wonder whether there is something wrong in the way the
pupil has set up the tables. (Certainly none of the forms worked.) I have
looked at the design view of the tables, field lengths and types match. This
is now getting a bit complicated to explain, so will finish there.
Many thanks for your help.