G
Guest
I was given this code to allow me to add a new record and add seven days
from the previous record.
With Me.RecordsetClone
.AddNew
EmployeeID = Me.EmployeeID
WeekID = DateAdd("d", 7, Me.WeekID)
Department = Me.Dept
Subdept = Me.Subdept
Costcentre = Me.Costcentre
Rate = Me.Rate
Contracthrs = 0
timehalfhrs = 0
doublehrs = 0
.Update
End With
Instead of creating a new record, it updates the most recent record.
I am having a problem with the ".update" line. It says I have a "3201"
run-time error:
"You cannot add or change a record becasue a related record is required in
table 'employee' "
When I add a record normally, it works fine.
Any ideas,
cheers in advance.
from the previous record.
With Me.RecordsetClone
.AddNew
EmployeeID = Me.EmployeeID
WeekID = DateAdd("d", 7, Me.WeekID)
Department = Me.Dept
Subdept = Me.Subdept
Costcentre = Me.Costcentre
Rate = Me.Rate
Contracthrs = 0
timehalfhrs = 0
doublehrs = 0
.Update
End With
Instead of creating a new record, it updates the most recent record.
I am having a problem with the ".update" line. It says I have a "3201"
run-time error:
"You cannot add or change a record becasue a related record is required in
table 'employee' "
When I add a record normally, it works fine.
Any ideas,
cheers in advance.