update query help

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.
 
N

NathanJ

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
 
G

Guest

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.
 
J

John Spencer

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.
 
G

Guest

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.
 
J

John Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top