I want to suppress the Access Warning message when this code is run. No matter where I place my "docmd.setwarnings false", I still get the Access message.
What am I doing wrong???
This code is within the "Not-In-List" Event of a combo box.
Dim ans As String
DoCmd.SetWarnings False
ans = MsgBox("This item is not in the list. Do you wish to add it?", vbYesNo, "Add Item")
If ans = vbYes Then
Me.cboVesselID = Null
DoCmd.OpenForm "frmCountryMaintain", acNormal, , , acFormAdd
DoCmd.GoToControl "txtDescription"
Else
[Forms]![frmShipments]![cboCountry] = Null
DoCmd.GoToControl "cboProductID"
End If
DoCmd.SetWarnings True
Thanks
BJS
What am I doing wrong???
This code is within the "Not-In-List" Event of a combo box.
Dim ans As String
DoCmd.SetWarnings False
ans = MsgBox("This item is not in the list. Do you wish to add it?", vbYesNo, "Add Item")
If ans = vbYes Then
Me.cboVesselID = Null
DoCmd.OpenForm "frmCountryMaintain", acNormal, , , acFormAdd
DoCmd.GoToControl "txtDescription"
Else
[Forms]![frmShipments]![cboCountry] = Null
DoCmd.GoToControl "cboProductID"
End If
DoCmd.SetWarnings True
Thanks
BJS