Not in list warning

  • Thread starter Thread starter CJ
  • Start date Start date
C

CJ

Hi Groupies

I have used Docmd Setwarnings False many times before but this time
I seem to need some assistance.

My field is a combo box.
Limit to list is Yes. (bound integer field is not visible)
My code without the SetWarnings is as follows:

Private Sub Model_NotInList(NewData As String, Response As Integer)

Dim strMsg As String

strMsg = strMsg & "Add " & NewData & " to the list?"

If MsgBox(strMsg, vbQuestion + vbYesNo, "Item Not Available") = vbNo
Then
Response = acDataErrContinue
Else
Me.Undo
Me.Dirty = False
DoCmd.OpenForm "frmModel"
DoCmd.GoToRecord , , acNewRec
Forms!frmModel!lngMakeID.Value = Forms!frmInventory.Make
Forms!frmModel!strModel.SetFocus
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
End Sub

I have tried turning off the warnings everywhere throughout
the code but to no avail.
I have no other code running off of this field.

Any ideas? What am I missing?
 
Back
Top