seestevecode
New member
- Local time
- Today, 17:13
- Joined
- Apr 19, 2008
- Messages
- 7
Hi. I am exporting data from Excel into Access temp tables and then trying to write update/append queries to transfer the data to permanent tables.
I have this scenario:
STAFF table
StaffID [Autonumber] [PK]
StaffCode
PRODUCTIVITY table
ProductivityID [Autonumber] [PK]
Date
StaffID [FK to STAFF table]
WidgetsCranked
TEMP table [no PK]
Date
StaffCode
WidgetsCranked
For example:
STAFF table
ID Code
Auto ab123
Auto cd456
PRODUCTIVITY table
Date Code Widgets
1/4 ab123 10
TEMP table
Date Code Widgets
1/4 ab123 20
1/4 cd456 20
1/4 ef789 20
I would want the first record in the TEMP table to UPDATE the record in the PRODUCTIVITY table; the second record in TEMP to APPEND to the PRODUCTIVITY table; and something to happen for the third record in TEMP to prompt for the user to add details for ef789 so a record can be created in the STAFF table.
I think I have the first two bits sorted but don't know how to do the third, and whenever I have records in my TEMP table that don't have existing StaffCodes in the STAFF table, they aren't getting appended.
Thanks for any help you can offer.
I have this scenario:
STAFF table
StaffID [Autonumber] [PK]
StaffCode
PRODUCTIVITY table
ProductivityID [Autonumber] [PK]
Date
StaffID [FK to STAFF table]
WidgetsCranked
TEMP table [no PK]
Date
StaffCode
WidgetsCranked
For example:
STAFF table
ID Code
Auto ab123
Auto cd456
PRODUCTIVITY table
Date Code Widgets
1/4 ab123 10
TEMP table
Date Code Widgets
1/4 ab123 20
1/4 cd456 20
1/4 ef789 20
I would want the first record in the TEMP table to UPDATE the record in the PRODUCTIVITY table; the second record in TEMP to APPEND to the PRODUCTIVITY table; and something to happen for the third record in TEMP to prompt for the user to add details for ef789 so a record can be created in the STAFF table.
I think I have the first two bits sorted but don't know how to do the third, and whenever I have records in my TEMP table that don't have existing StaffCodes in the STAFF table, they aren't getting appended.
Thanks for any help you can offer.