I have this code to update my combo list when NewData is entered. NewData is not updating in the cbo box. I am new and still learning. Please help.
Private Sub POC_NotInList(NewData As String, Response As Integer)
On Error GoTo cboPOC_NotInList_Err
Dim intAnswer As Integer
Dim strSQL As String
intAnswer = MsgBox("POC " & Chr(34) & NewData & _
Chr(34) & " is not currently listed." & vbCrLf & _
"Would you like to add it to the list now?" _
, vbQuestion + vbYesNo, " POC")
If intAnswer = vbYes Then
strSQL = "INSERT INTO MARK20A([POC]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
MsgBox "The new POC has been added to the list." _
, vbInformation, "POC "
Response = acDataErrAdded
Else
MsgBox "Please choose a POC from the list." _
, vbInformation, " "
Response = acDataErrContinue
End If
Private Sub POC_NotInList(NewData As String, Response As Integer)
On Error GoTo cboPOC_NotInList_Err
Dim intAnswer As Integer
Dim strSQL As String
intAnswer = MsgBox("POC " & Chr(34) & NewData & _
Chr(34) & " is not currently listed." & vbCrLf & _
"Would you like to add it to the list now?" _
, vbQuestion + vbYesNo, " POC")
If intAnswer = vbYes Then
strSQL = "INSERT INTO MARK20A([POC]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
MsgBox "The new POC has been added to the list." _
, vbInformation, "POC "
Response = acDataErrAdded
Else
MsgBox "Please choose a POC from the list." _
, vbInformation, " "
Response = acDataErrContinue
End If