ComboBox NotInList problem

basilyos

Registered User.
Local time
Today, 12:35
Joined
Jan 13, 2014
Messages
256
Hello Guys

i want to add the text that in not in the combobox list

here is my code

Code:
Private Sub video_series_NotInList(NewData As String, Response As Integer)
On Error GoTo video_series_NotInList_Err
    Dim intAnswer As Integer
    Dim strSQL As String
    intAnswer = MsgBox("The Serie " & Chr(34) & NewData & _
    Chr(34) & " is not currently listed." & vbCrLf & _
    "Would you like to add it to the list now?", vbQuestion + vbYesNo, "RyBaKoV Database - Add Serie to the list")

    If intAnswer = vbYes Then
    strSQL = "INSERT INTO tbl_videos_series(video_series) " & _
             "VALUES ('" & NewData & "');"
    DoCmd.SetWarnings False
    DoCmd.RunSQL strSQL
    DoCmd.SetWarnings True
    MsgBox "The new Serie has been added to the list." _
        , vbInformation, "RyBaKoV Database - Add Serie to the list"
    Response = acDataErrAdded
    Else
        MsgBox "Please choose a Serie from the list." _
            , vbInformation, "RyBaKoV Database - Add Serie to the list"
        Response = acDataErrContinue
    End If
video_series_NotInList_Exit:
    Exit Sub
video_series_NotInList_Err:
    MsgBox Err.Description, vbCritical, "Error"
    Resume video_series_NotInList_Exit
End Sub


i type the word and it's not in the list but nothing happened

i'm using access 2013

any help?
 
requery your combobox after adding the new record.

MsgBox "The new Serie has been added to the list." _
, vbInformation, "RyBaKoV Database - Add Serie to the list"
Response = acDataErrAdded
Me.video_series.Requery
Me.video_series.Value = NewData
 
the problem is i don't get the first msgbox
 
thank you guys for your helo my problem was that i didn't set limit to list to yes
 

Users who are viewing this thread

Back
Top Bottom