cloning a record

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top