SirStevie3
Registered User.
- Local time
- Today, 13:14
- Joined
- Jul 29, 2013
- Messages
- 58
I have a form that is used in datasheet mode. It is based on a query that pulls fields from table A that has a foreign key (pointing to table B). I'm using this form as a way to quickly copy and paste data from an excel spreadsheet and get it into the database.
The problem is for a specific field. The foreign key (pointing to table B). If the new data in the foreign key field doesn't match an existing primary key already in table B, I get an error.
So I switched the query to include the primary key from table B instead of the foreign key that points to table B. And now I get an error if the data going into that field is a duplicate of an already existing primary key (obviously we cant have duplicate primary keys).
How can I paste this data so that I'm filling in the foreign key in table A, but also creating a new primary key in table B if needed?
sorry if I didn't use the correct terms... learning as I go here.
Thanks in advance!
The problem is for a specific field. The foreign key (pointing to table B). If the new data in the foreign key field doesn't match an existing primary key already in table B, I get an error.
So I switched the query to include the primary key from table B instead of the foreign key that points to table B. And now I get an error if the data going into that field is a duplicate of an already existing primary key (obviously we cant have duplicate primary keys).
How can I paste this data so that I'm filling in the foreign key in table A, but also creating a new primary key in table B if needed?
sorry if I didn't use the correct terms... learning as I go here.
Thanks in advance!