cloning a record


G

Guest

I am using the following code in a button on the form to clone a record in
the subform.

With Me![Employee subform].Form.RecordsetClone
.AddNew
!EmployeeID = Me![Employee subform].Form![EmployeeID]
!Dept = Me![Employee subform].Form![Dept]
!Subdept = Me![Employee subform].Form![Subdept]
!Wage = Me![Employee subform].Form![Wage]
!HrsWrk_basic = 36
.Update
End With


I want to change the code so that it can be used in an update event in the
subform. I appreciate it can't be that difficult but not too sure how to
change the first line.

thanks
 
Ad

Advertisements

S

Scott McDaniel

I am using the following code in a button on the form to clone a record in
the subform.

With Me![Employee subform].Form.RecordsetClone
.AddNew
!EmployeeID = Me![Employee subform].Form![EmployeeID]
!Dept = Me![Employee subform].Form![Dept]
!Subdept = Me![Employee subform].Form![Subdept]
!Wage = Me![Employee subform].Form![Wage]
!HrsWrk_basic = 36
.Update
End With


I want to change the code so that it can be used in an update event in the
subform. I appreciate it can't be that difficult but not too sure how to
change the first line.

Change any of these:

Me![Employee subform].Form

to just

Me

So Me![Employee subform].Form![EmployeeID] would become Me![EmployeeID]

Scott McDaniel
[email protected]_infotrakker.com
www.infotrakker.com
 
G

Guest

thanks for the clarification. Its the first line I'm not sure about.

"With Me![Employee subform].Form.RecordsetClone"




Scott McDaniel said:
I am using the following code in a button on the form to clone a record in
the subform.

With Me![Employee subform].Form.RecordsetClone
.AddNew
!EmployeeID = Me![Employee subform].Form![EmployeeID]
!Dept = Me![Employee subform].Form![Dept]
!Subdept = Me![Employee subform].Form![Subdept]
!Wage = Me![Employee subform].Form![Wage]
!HrsWrk_basic = 36
.Update
End With


I want to change the code so that it can be used in an update event in the
subform. I appreciate it can't be that difficult but not too sure how to
change the first line.

Change any of these:

Me![Employee subform].Form

to just

Me

So Me![Employee subform].Form![EmployeeID] would become Me![EmployeeID]

Scott McDaniel
[email protected]_infotrakker.com
www.infotrakker.com
 
Ad

Advertisements

Ad

Advertisements


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