2010 Access 32 bit database running on Windows 7 32 bit
The database functions without any problems until I convert it to an .accde or .accdr.
I have a form with the following in its BeforeUpdate event:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo errHandler
Const MESSAGE_TEXT = "You didn't mark the DRAI Offense in B1. Delete the score you entered for B1, check the most serious offense as the DRAI Offense, and re-enter the B1 score."
Dim strCriteria As String
strCriteria = "Chosen = True And ReferralID = " & Me.ReferralID
If Not IsNull(Me.IIA) Then
If DCount("*", "PresentingOffenses", strCriteria) = 0 Then
MsgBox MESSAGE_TEXT, vbExclamation, "Invalid Operation"
Cancel = True
End If
End If
Exit Sub
errHandler:
MsgBox "Error " & Err.Number & ": " & Err.Description & " in " & _
VBE.ActiveCodePane.CodeModule, vbOKOnly, "Error"
End Sub
This is called when I choose a charge(s) on the Charges subform but fail to check the checkbox next to the most serious charge, and then return to the main form to enter a score corresponding to that most significant charge.
Full version database, all works well. On the runtime and .accde the message displays and immediately following I get the attached error. I click on OK and the error message goes away. The box where I enter the score had an "after update" event but I removed it and I continue to get the same error. I don't know what is causing the error, and it doesn't seem to do anything but irritate. How can I get rid of the message box? Thanks in advance.
The database functions without any problems until I convert it to an .accde or .accdr.
I have a form with the following in its BeforeUpdate event:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo errHandler
Const MESSAGE_TEXT = "You didn't mark the DRAI Offense in B1. Delete the score you entered for B1, check the most serious offense as the DRAI Offense, and re-enter the B1 score."
Dim strCriteria As String
strCriteria = "Chosen = True And ReferralID = " & Me.ReferralID
If Not IsNull(Me.IIA) Then
If DCount("*", "PresentingOffenses", strCriteria) = 0 Then
MsgBox MESSAGE_TEXT, vbExclamation, "Invalid Operation"
Cancel = True
End If
End If
Exit Sub
errHandler:
MsgBox "Error " & Err.Number & ": " & Err.Description & " in " & _
VBE.ActiveCodePane.CodeModule, vbOKOnly, "Error"
End Sub
This is called when I choose a charge(s) on the Charges subform but fail to check the checkbox next to the most serious charge, and then return to the main form to enter a score corresponding to that most significant charge.
Full version database, all works well. On the runtime and .accde the message displays and immediately following I get the attached error. I click on OK and the error message goes away. The box where I enter the score had an "after update" event but I removed it and I continue to get the same error. I don't know what is causing the error, and it doesn't seem to do anything but irritate. How can I get rid of the message box? Thanks in advance.