| re: Auto field entry
Okay, so you should have a Long Integer type field in the Detail table
that you use to link to the Main Table. Once you have that, you can
join the two tables. This may not work if you have data in the two
tables and you violate referential integrity.
I know it's coming, so let me explain that. (Ready for a bit of set
math?) Basically, you cannot create a relationship between two tables
if there are values in the *child* table (Detail table, in your case)
that are NOT in the primary key of the main/parent table.
You can find these records that would cause this by using the Find
Unmatched query wizard. Or use something like this:
SELECT Detail.[Case Number]
FROM Detail LEFT JOIN MainTable ON Detail.[CaseNumber]=MainTable.ID
WHERE MainTable.ID IS NULL;
Then you should get the list of all key values that are causing your
problem. Then you can change the filter to NOT NULL instead of NULL
and append those to a new table and enforce integrity there... |