D
Del
I want to change the error message displayed in Access 2000 when the user
enters a value in a combo box that is not in the list. I've tried the
following code but the system message still appears.
Private Sub SupplierName_NotInList(NewData As String, Response As Integer)
If MsgBox("'" & NewData & "' is not in list. Add?", vbYesNo) = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert Into tblYourTable (YourFieldName) Values('" & _
NewData & "')"
DoCmd.SetWarnings True
Response = acDataErrAdded
Else
Response = acDataErrContinue
MsgBox "Mate, retype or select something from the list"
End If
End Sub
enters a value in a combo box that is not in the list. I've tried the
following code but the system message still appears.
Private Sub SupplierName_NotInList(NewData As String, Response As Integer)
If MsgBox("'" & NewData & "' is not in list. Add?", vbYesNo) = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunSQL "Insert Into tblYourTable (YourFieldName) Values('" & _
NewData & "')"
DoCmd.SetWarnings True
Response = acDataErrAdded
Else
Response = acDataErrContinue
MsgBox "Mate, retype or select something from the list"
End If
End Sub