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
 
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
scott@takemeout_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
scott@takemeout_infotrakker.com
www.infotrakker.com
 
G

Guest

I won't start a new message. I think my problem can be solved a bit more
easily.

Thanks for the heads up.


Scott McDaniel said:
thanks for the clarification. Its the first line I'm not sure about.

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

That should be Me.RecordsetClone

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

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