Hi Annemarie,
You possibly have a cartesian product query in the recordsource for the
subform. A cartesian product results when a query contains more than one
table, but there is no join established between one or more of the tables.
When this happens, the recordset will contain the number of records selected
from each table multiplied together. As an example, open the Northwind sample
database (Northwind.mdb). Add the Customers table and the Order Details table
to the query. Select the Company Name and Quantity fields. When you run the
query, you should see 196,105 records (example given for a "clean" copy [ie.
no deleted or added records] in the copy of Northwind that shipped with
Access 2003). There are 91 customer records multiplied by 2155 Order Detail
records (91 * 2155 = 196,105).
Open the query in design view. Add the Orders table. When you re-run the
query, you should see that the recordset now contains 2155 records. You
should also see how the three tables have join lines.
Another possibility is that you are including fields in the SELECT portion
of the query that come from child tables. For example, in the above fixed
version of the query with 2155 records, we see "Alfreds Futterkiste" listed
12 times. In this case, you might want to have the Quantity as a part of the
WHERE clause in the query, but not in the SELECT. Perhaps using a grouped
query (or adding the DISTINCT keyword) will help prevent your triplicate
records.
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
Annemarie said:
I have a look up form that searches the database for names. When I select an
option to search by, the subform displays the results 3 times. I only have
each person listed once in the database, but for some reason the look up is
showing 3. Any ideas?