I have a data entry application. The records are claims that are being submitted for payment, and the claims are grouped in batches. The default action when the claim form is opened, is to add a claim. The primary key consists of the batch and claim numbers. Upon entry, the batch number is filled in but not the claim number, because that's dependent on the doctor chosen. Rather than enter a new claim, I choose to modify a previous claim that was rejected. So I use recordset clones to copy the data into a new record. All that works. But when I try to finish the process by syncing the recordset clone with the original recordset, I get an error that it can't save a record with a null primary key. I need to know how to delete the first record that was started upon entry or overwrite it with the new record.
Here's the code
Set rstNew = .RecordsetClone
Set rstOld = .RecordsetClone
strCrit = "Claim='" & strClaim & "'" ' to get original claim data
For Each fld In rstOld.Fields
' code that copies the data
' from the original record to the new one
' it works
ErrMsg = "Copying cleanup"
Me.Bookmark = .Bookmark ' sync form to added record
Thanks in advance for any suggestions.
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>