For a database I developed in an old job I used the following code in the
double click event of a button to create a new record that had replicated
information.
Just change the field names.
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
end sub
DominicGreco - 16 May 2008 14:12 GMT
Thanks for the suggestion. I would probably just atach this code behind my
"Next Record" button. This way all the field values I want to save are saved
when I hit it.
I'm assuming that the line of code with the "!" extension are your user
variables. And that these correspond to field names whose value you wanted to
save. Correct?
I can see where this saves them. But how do you populate the list or text box
with the appropriate value? Or how do you recover the saved information?
>For a database I developed in an old job I used the following code in the
>double click event of a button to create a new record that had replicated
[quoted text clipped - 19 lines]
>
>end sub