update query help

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

Guest

I have a main form (called "employee") and a subform (called "department").
The two forms are connected using "EmployeeID" and I want to update the field
[rate] in the "department" subform from another table called "Sheet 1" (which
is temporary). "Sheet 1" has two fields [employeeID] and [rate].

I want to put the information from [Sheet1].[rate] into [department].[rate]
using [employeeID] as the indicator but i'm not too sure of the SQL. The rows
in the "department" subform already have multiple rows.

cheers.
 
UPDATE tblDepartment
set departmentRate = forms!Sheet1.rate
WHERE tblDepartment.EmployeeID = forms!Sheet1.EmployeeID;

I think that is what you're looking for.
I hope it helps
 
I had originally created the query so it would change the rate for weekID and
EmployeeID. It did work but I have decided to simplify it just to employee.

Can you tell me what might be wrong with the following. I want to update the
information from "sheet1" to "department":

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

I get an "enter parameter value" for the following:

forms!sheet1.employeeID



NathanJ said:
UPDATE tblDepartment
set departmentRate = forms!Sheet1.rate
WHERE tblDepartment.EmployeeID = forms!Sheet1.EmployeeID;

I think that is what you're looking for.
I hope it helps

I have a main form (called "employee") and a subform (called "department").
The two forms are connected using "EmployeeID" and I want to update the field
[rate] in the "department" subform from another table called "Sheet 1" (which
is temporary). "Sheet 1" has two fields [employeeID] and [rate].

I want to put the information from [Sheet1].[rate] into [department].[rate]
using [employeeID] as the indicator but i'm not too sure of the SQL. The rows
in the "department" subform already have multiple rows.

cheers.
 
Try replacing the periods with exclamation marks. Also make sure that the
controls have the exact name you are referring to.

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

If you still get a parameter request, then it is likely that you have
misspelled something.

scubadiver said:
I had originally created the query so it would change the rate for weekID
and
EmployeeID. It did work but I have decided to simplify it just to
employee.

Can you tell me what might be wrong with the following. I want to update
the
information from "sheet1" to "department":

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

I get an "enter parameter value" for the following:

forms!sheet1.employeeID



NathanJ said:
UPDATE tblDepartment
set departmentRate = forms!Sheet1.rate
WHERE tblDepartment.EmployeeID = forms!Sheet1.EmployeeID;

I think that is what you're looking for.
I hope it helps

I have a main form (called "employee") and a subform (called
"department").
The two forms are connected using "EmployeeID" and I want to update the
field
[rate] in the "department" subform from another table called "Sheet 1"
(which
is temporary). "Sheet 1" has two fields [employeeID] and [rate].

I want to put the information from [Sheet1].[rate] into
[department].[rate]
using [employeeID] as the indicator but i'm not too sure of the SQL.
The rows
in the "department" subform already have multiple rows.

cheers.
 
I've replaced mine with yours and I still get an "enter parameter value"
message for:

[forms]![sheet1]![employeeID]

John Spencer said:
Try replacing the periods with exclamation marks. Also make sure that the
controls have the exact name you are referring to.

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

If you still get a parameter request, then it is likely that you have
misspelled something.

scubadiver said:
I had originally created the query so it would change the rate for weekID
and
EmployeeID. It did work but I have decided to simplify it just to
employee.

Can you tell me what might be wrong with the following. I want to update
the
information from "sheet1" to "department":

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

I get an "enter parameter value" for the following:

forms!sheet1.employeeID



NathanJ said:
UPDATE tblDepartment
set departmentRate = forms!Sheet1.rate
WHERE tblDepartment.EmployeeID = forms!Sheet1.EmployeeID;

I think that is what you're looking for.
I hope it helps


scubadiver wrote:
I have a main form (called "employee") and a subform (called
"department").
The two forms are connected using "EmployeeID" and I want to update the
field
[rate] in the "department" subform from another table called "Sheet 1"
(which
is temporary). "Sheet 1" has two fields [employeeID] and [rate].

I want to put the information from [Sheet1].[rate] into
[department].[rate]
using [employeeID] as the indicator but i'm not too sure of the SQL.
The rows
in the "department" subform already have multiple rows.

cheers.
 
It sounds as if the form isn't open or the control on the form has a
different name. Or the form has a different name.

scubadiver said:
I've replaced mine with yours and I still get an "enter parameter value"
message for:

[forms]![sheet1]![employeeID]

John Spencer said:
Try replacing the periods with exclamation marks. Also make sure that
the
controls have the exact name you are referring to.

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

If you still get a parameter request, then it is likely that you have
misspelled something.

scubadiver said:
I had originally created the query so it would change the rate for
weekID
and
EmployeeID. It did work but I have decided to simplify it just to
employee.

Can you tell me what might be wrong with the following. I want to
update
the
information from "sheet1" to "department":

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

I get an "enter parameter value" for the following:

forms!sheet1.employeeID



:

UPDATE tblDepartment
set departmentRate = forms!Sheet1.rate
WHERE tblDepartment.EmployeeID = forms!Sheet1.EmployeeID;

I think that is what you're looking for.
I hope it helps


scubadiver wrote:
I have a main form (called "employee") and a subform (called
"department").
The two forms are connected using "EmployeeID" and I want to update
the
field
[rate] in the "department" subform from another table called "Sheet
1"
(which
is temporary). "Sheet 1" has two fields [employeeID] and [rate].

I want to put the information from [Sheet1].[rate] into
[department].[rate]
using [employeeID] as the indicator but i'm not too sure of the SQL.
The rows
in the "department" subform already have multiple rows.

cheers.
 
Back
Top