Quote:
|
Originally Posted by Dev1 It was implied that the OwnerID was a column in the the table (autonumbering). I didn't realize that I had to be so explicit. Usually that is implied! |
Hi Dev1. You know your data, but we don't, and what is an implication to you is missing data to us that makes answering your post (and solving what is after all a problem that you are seeking a solution to!) more difficult.
Here is an example of how to post table MetaData :
Table Name=tblStudent - Field; Type; IndexInfo
-
StudentID; AutoNumber; PK
-
Family; String; FK
-
Name; String
-
University; String; FK
-
Mark; Numeric
-
LastAttendance; Date/Time
On post #1, it would be helpful to see some sample data. You have autonumber primary keys on both tables. Presumably the Owner ID foreign key in table Company is a Long Integer value (it cannot be an autonumber, as it would generate different key values that are not the same as the true primary key autonumber in your Owner table.
If there are no key values listed in your composite Excel table then the values appended to your Owner table will not have any direct relation to the Company table, as the autonumber is created for the first time as you append the rows. Setting the value of the Owner ID foreign key in your Company table from an autonumber in another table created only at append time is difficult; you would have to do some form of lookup of the value assigned based on performing some kind of transform of the data in your Owner table to come up with an alternate candidate key.
As the autonumbers in your Access tables are added at the append stage they are not any part of the data transferred. They are not candidate keys for your data, in the sense of identifying what makes your row data unique. Instead of using autonumbers after the event look for a candidate key from within your data, make that the primary key of your Owner table, then carry that forward as your foreign key in the Company table and you WILL be able to match the two tables on the key value. You are going to have to identify an alternate candidate key anyway to be able to lookup the autonumbers generated by the append as mentioned above.
-Stewart