update query help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to update information from "Sheet1" to "department". The fields I want
to copy from and to are both called "rate" and I want to match "EmployeeID"
(the same in each table). Here is my SQL:

UPDATE Department
SET [Department]![Rate] = [forms]![sheet1]![rate]
WHERE ([forms]![sheet1]![employeeID]=[Department]![EmployeeID]);

I get an "Enter Parameter Value" box for "forms!sheet1!rate". Not too sure
what is going on. Is my SQL correct?
 
The where condition should be the other way around

UPDATE Department
SET [Department]![Rate] = [forms]![sheet1]![rate]
WHERE [Department]![EmployeeID]=[forms]![sheet1]![employeeID]

Check again if the names of the form and the field are correct
The Form need to be open when this SQL runs
If Sheet1 is a subform, the path need to be different

[forms]![MainFormName]![SubFormControlName].Form![employeeID]
 
Hello Ofer,

Thanks for the reply.

"Sheet1" is a temporary table which I will delete and "Department" is a
subform but I didn't realise it would make a difference.

My SQL maybe a bit more complicated than I thought.

Ofer Cohen said:
The where condition should be the other way around

UPDATE Department
SET [Department]![Rate] = [forms]![sheet1]![rate]
WHERE [Department]![EmployeeID]=[forms]![sheet1]![employeeID]

Check again if the names of the form and the field are correct
The Form need to be open when this SQL runs
If Sheet1 is a subform, the path need to be different

[forms]![MainFormName]![SubFormControlName].Form![employeeID]
--
Good Luck
BS"D


scubadiver said:
I want to update information from "Sheet1" to "department". The fields I want
to copy from and to are both called "rate" and I want to match "EmployeeID"
(the same in each table). Here is my SQL:

UPDATE Department
SET [Department]![Rate] = [forms]![sheet1]![rate]
WHERE ([forms]![sheet1]![employeeID]=[Department]![EmployeeID]);

I get an "Enter Parameter Value" box for "forms!sheet1!rate". Not too sure
what is going on. Is my SQL correct?
 
Back
Top