R
richardb
I am adding records to a table (tblMSRUsed) that records Medical Service
Record (MSR) numbers that have been used. To prevent using an MSR more than
once, I made the MSR column the "Primary Key". When adding a new record, I
trap error 3022. I believe the error should only occur if the MSR is already
in the table when I add a record. Instead I always get error 3022, even if
the new MSR is not already in tblMSRUsed, and can prevent the error only by
completely emptying tblMSRUsed before adding a record. Here is part of my
code. Perhaps someone can see my error please:
Set rsMSR = db.OpenRecordset("tblMSRUsed")
With rsMSR
.AddNew
!MSR = MSRNumber
!PatUniqueID = PatientID$
!ApptDate = AppointmentDate$
!Resource = Provider$
.Update
End With
An Error Handler displays Case Err.Number = 3022
Thank you, Richard
Record (MSR) numbers that have been used. To prevent using an MSR more than
once, I made the MSR column the "Primary Key". When adding a new record, I
trap error 3022. I believe the error should only occur if the MSR is already
in the table when I add a record. Instead I always get error 3022, even if
the new MSR is not already in tblMSRUsed, and can prevent the error only by
completely emptying tblMSRUsed before adding a record. Here is part of my
code. Perhaps someone can see my error please:
Set rsMSR = db.OpenRecordset("tblMSRUsed")
With rsMSR
.AddNew
!MSR = MSRNumber
!PatUniqueID = PatientID$
!ApptDate = AppointmentDate$
!Resource = Provider$
.Update
End With
An Error Handler displays Case Err.Number = 3022
Thank you, Richard