G
Guest
Here is a code I have for replicating the last record. The button is
currently in the same subform in which I am entering records.
Private Sub TempSt_DblClick(Cancel As Integer)
With Me.RecordsetClone
.AddNew
!EmployeeID = Me.EmployeeID
!WeekID = DateAdd("d", 7, Me.WeekID)
!Dept = Me.Dept
!Subdept = Me.Subdept
!Costcentre = Me.Costcentre
!Rate = Me.Rate
!Contracthrs = 0
!timehalfhrs = 0
!doublehrs = 0
.Update
End With
DoCmd.GoToControl "Contracthrs"
DoCmd.GoToRecord , , acLast
End Sub
I have decided to move the button from the subform to the main form.
The main form is called "employee" and contains a subform called "department
subform" which contains the "department" form (where the buttons currently
reside).
I am not entirely sure what I have to replace "Me.Dept" with for it to be
successful (something straightforward).
Thanks in advance.
currently in the same subform in which I am entering records.
Private Sub TempSt_DblClick(Cancel As Integer)
With Me.RecordsetClone
.AddNew
!EmployeeID = Me.EmployeeID
!WeekID = DateAdd("d", 7, Me.WeekID)
!Dept = Me.Dept
!Subdept = Me.Subdept
!Costcentre = Me.Costcentre
!Rate = Me.Rate
!Contracthrs = 0
!timehalfhrs = 0
!doublehrs = 0
.Update
End With
DoCmd.GoToControl "Contracthrs"
DoCmd.GoToRecord , , acLast
End Sub
I have decided to move the button from the subform to the main form.
The main form is called "employee" and contains a subform called "department
subform" which contains the "department" form (where the buttons currently
reside).
I am not entirely sure what I have to replace "Me.Dept" with for it to be
successful (something straightforward).
Thanks in advance.