OK, I know what you mean now. When the issue was happening last month, there was real corruption and it was creating an MSysCompactError table. Now, nothing is being created.
I'm not trying to be stubborn about the indexed field, but I'm just curious why it would be breaking down now and not in the past 3 years? We used to have up to 30 people using the FE at once...now it's down to 12.
I removed most of the foreign fields from the form and nearly all of the controls that grab foreign values are locked.
The domain function runs on a separate form. They cannot create new records with the form that we've been talking about. I have a "new load" form that only accepts the bare minimum info and then the save button runs the domain function and then opens the other form up filtered to the newly created record. Here is the code (please be gentle, I know it's a little ugly):
Code:
Private Sub cmdSave_Click()
Dim strProNum As String
On Error Resume Next
Me.Refresh
Me!PRO = DMax("PRO", "Loads") + 1
strProNum = Me!PRO
Me!CustomerID = Me!cboShipper.Value
Me!FleetID = Me!cboFleet.Value
Me!VendorID = Me!cboVendor.Value
Me!ConsigneeID = Me!cboConsignee.Value
Me!CarrierLH = intCarrierLH
Me!CarrierFSC = intCarrierFSC
Me!Expense = intCarrierLH + intCarrierFSC
Me.Refresh
Me.Dirty = False
DoCmd.Close , "", acSaveYes
DoCmd.OpenForm "frmDailyOpsLoadDetail", acNormal, , "[PRO] = " & strProNum
End Sub
As you see, it grabs the PK value at practically the same instant that the record is written. I guess it would be better if I put the function at the very end just in case, but it's a matter of milliseconds at most.