J
Julian Cropley
I have some code which I am writing, and it currently has
me baffled. After the below procedure has run once and
presumably deleted a record, the next piece of code to
run that accesses this table comes up with error 3167:
Record is deleted. Am I forgetting something when I
delete?
Private Sub makeAvailable(Day, hours, minutes)
Dim hoursUnavailableRST As DAO.Recordset
Dim sql As String
sql = "select * from staffHrsAvailability where staffid="_
& Me.StaffID & " and day=" & "'" & Day & _
"' AND [Start Time]= #" & _
Format$(Format$(Str(hours), "00") & ":" & _
Format$(Str(minutes), "00"), "Long Time") & "#;"
Set hoursUnavailableRST = CurrentDb.OpenRecordset(sql,
dbOpenDynaset, dbSeeChanges)
hoursUnavailableRST.MoveFirst
hoursUnavailableRST.Delete
hoursUnavailableRST.Close
Set hoursUnavailableRST = Nothing
End Sub
help much appreciated
Julian Cropley
me baffled. After the below procedure has run once and
presumably deleted a record, the next piece of code to
run that accesses this table comes up with error 3167:
Record is deleted. Am I forgetting something when I
delete?
Private Sub makeAvailable(Day, hours, minutes)
Dim hoursUnavailableRST As DAO.Recordset
Dim sql As String
sql = "select * from staffHrsAvailability where staffid="_
& Me.StaffID & " and day=" & "'" & Day & _
"' AND [Start Time]= #" & _
Format$(Format$(Str(hours), "00") & ":" & _
Format$(Str(minutes), "00"), "Long Time") & "#;"
Set hoursUnavailableRST = CurrentDb.OpenRecordset(sql,
dbOpenDynaset, dbSeeChanges)
hoursUnavailableRST.MoveFirst
hoursUnavailableRST.Delete
hoursUnavailableRST.Close
Set hoursUnavailableRST = Nothing
End Sub
help much appreciated
Julian Cropley