I'll explain how I get to this query before I actually write it out. A user puts two columns of data into an Excel spreadsheet. That data gets put into a temporary table from a button push inside Access. The two columns are "EmpNo" and "PositionNo". I have tblEmployee and tblPositionNumbers.
- tblEmployee has tblEmployee.PRI and tblEmployee.PNID.
- tblPositionNumbers has tblPositionNumbers.ID and tblPositionNumbers.PositionNumber.
- tblEmployee.PNID and tblPositionNumbers.ID are related.
Before someone asks, many employees can occupy one position number. That's why I have a table for position numbers. That way, position numbers are easier to update (there are other fields in tblPositionNumber, but none are consequential to this question).
Once the user confirms the import to Access was correct, I want to update tblEmployee.PNID to reflect any changes.
The query I currently have is:
Code:
UPDATE tblEmployee SET tblEmployee.PositionNumber = tblImportTMP.PNID
WHERE (([tblEmployee].[EmpNo]=[tblImportTMP].[EmpNo]));
When I run the query, it is asking for a value for tblImportTMP.EmpNo, but I'm not sure why.
Thanks for any help!
Scott