LimitToList is set to True in my cbo box. When I attempt to add a value that is not in the list, my code runs and is followed by:
1. "Error #0" message. This error has no description.
2. "Characters found after end of SQL statement" message.
3. "Error #0" message again.
4. "The text you entered isn't an item in the list" message.
I'm totally lost and hope somebody sees what I'm doing wrong. Here's the code I'm using:
============================================
On Error GoTo Err_POC_NotInList
Dim ctl As Control
Set ctl = Forms!frmReqnWatch!POC
If MsgBox("That POC is not listed in the database." & Chr(10) & Chr(13) _
& " Do you want to add this name?", vbYesNo, "RPP Tracking System") = vbYes Then
Response = acDataErrAdded
ctl.RowSource = ctl.RowSource & ";" & NewData
Else
Response = acDataErrContinue
ctl.Undo
End If
Exit_POC_NotInList:
Exit Sub
Err_POC_NotInList:
MsgBox "Error #" & Err.Number & Chr(10) & Chr(13) & Err.Description, vbOKOnly, _
"RPP Tracking System"
Resume Exit_POC_NotInList
End Sub
1. "Error #0" message. This error has no description.
2. "Characters found after end of SQL statement" message.
3. "Error #0" message again.
4. "The text you entered isn't an item in the list" message.
I'm totally lost and hope somebody sees what I'm doing wrong. Here's the code I'm using:
============================================
On Error GoTo Err_POC_NotInList
Dim ctl As Control
Set ctl = Forms!frmReqnWatch!POC
If MsgBox("That POC is not listed in the database." & Chr(10) & Chr(13) _
& " Do you want to add this name?", vbYesNo, "RPP Tracking System") = vbYes Then
Response = acDataErrAdded
ctl.RowSource = ctl.RowSource & ";" & NewData
Else
Response = acDataErrContinue
ctl.Undo
End If
Exit_POC_NotInList:
Exit Sub
Err_POC_NotInList:
MsgBox "Error #" & Err.Number & Chr(10) & Chr(13) & Err.Description, vbOKOnly, _
"RPP Tracking System"
Resume Exit_POC_NotInList
End Sub