I'm using the following code, which is called from the BeforeUpdate event in
a form based on 'Tenant Details', to check for changes or additions to a
series of dates, and if changed, to edit another table - 'tDiary'.
Set rsDiary = db.OpenRecordset("SELECT * FROM tDiary WHERE LAN = " &
vLAN)
With rsDiary
If Me!LeaseExp <> Nz(Me!LeaseExp.OldValue, 0) And Not
IsNull(Me!LeaseExp) Then
.FindFirst "EventID = 1 AND NOT Done"
ws.BeginTrans
If Not .NoMatch Then .Delete
.AddNew
!LAN = vLAN
!DueDate = Me!LeaseExp
!EventID = 1
!Event = "Lease expires on " & Me!LeaseExp
.Update
ws.CommitTrans
End If
I have tested it extensively, and it works fine for me.
But with one client (using TS), it intermittently doesn't edit the Diary
table, and no errors are generated.
I can see no pattern to these failures, and cannot replicate them myself.
Can anyone see a problem with the code?
--
Bob Darlington
Brisbane