I have a main form with a subform. I have the following code on the main form:
ADPFileNo has an InputMask of 000000;;_ and AutoTab is Yes.
The 2279 error is working fine.
If I try to add a record with no ADPFileNo, I get Access' 3058 error message, not mine.
If I try to enter a duplicate ADPFileNo, as soon as it goes to the next field some controls that I have set as Enabled=False become True AND when I click my Save button I get Access' 3022 error message, not mine.
I have searched for answers and tried everything I read and can't get Form_Error to work. I've done a Compact and Repair.
And the controls becoming enabled is really throwing for a loop. This only happens if it is a duplicate.
Can anyone help me? I've run out of ideas.
Debbie
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
' MsgBox DataErr
Select Case DataErr
Case 2279 'InputMask violation
InputMaskMsg
Response = acDataErrContinue
Case 3022 'duplicate primary key
msgbox "dupe"
Response = acDataErrContinue
Case 3058 'empty primary key
msgbox "empty"
Response = acDataErrContinue
Case 3314 'cannot contain null, required is true
msgbox "null"
Response = acDataErrContinue
Case Else
Response = acDataErrDisplay
End Select
End Sub
ADPFileNo has an InputMask of 000000;;_ and AutoTab is Yes.
The 2279 error is working fine.
If I try to add a record with no ADPFileNo, I get Access' 3058 error message, not mine.
If I try to enter a duplicate ADPFileNo, as soon as it goes to the next field some controls that I have set as Enabled=False become True AND when I click my Save button I get Access' 3022 error message, not mine.
I have searched for answers and tried everything I read and can't get Form_Error to work. I've done a Compact and Repair.
And the controls becoming enabled is really throwing for a loop. This only happens if it is a duplicate.
Can anyone help me? I've run out of ideas.
Debbie