D
Deb
I'm sure this is a simple thing, and I'm quite sure I've left something out
of my code (below)
Private Sub cboPartNo_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
Dim ctl As Control
Set ctl = Screen.ActiveControl
strMsg = "The Part Number you entered, " & NewData & ", is not in the Part
Number List!" & _
vbCrLf & "Do you want to add it?"
If MsgBox(strMsg, vbYesNo, "Not listed") = vbYes Then
DoCmd.OpenForm "frm_PartNumbers"
Else
ctl.Undo
Response = acDataErrContinue
End If
End Sub
The code works just fine with the exception that when the form opens up for
entering the new part number information, an Access Message Box pops up and
indicates that the number entered in the combo box is not in the Part No
List, and wants the user to pick from the list. How do I keep this message
box from opening?
of my code (below)
Private Sub cboPartNo_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
Dim ctl As Control
Set ctl = Screen.ActiveControl
strMsg = "The Part Number you entered, " & NewData & ", is not in the Part
Number List!" & _
vbCrLf & "Do you want to add it?"
If MsgBox(strMsg, vbYesNo, "Not listed") = vbYes Then
DoCmd.OpenForm "frm_PartNumbers"
Else
ctl.Undo
Response = acDataErrContinue
End If
End Sub
The code works just fine with the exception that when the form opens up for
entering the new part number information, an Access Message Box pops up and
indicates that the number entered in the combo box is not in the Part No
List, and wants the user to pick from the list. How do I keep this message
box from opening?