Hi,

I have written a code for adding a Text if Not in the Combo Box..
It works fine but when i select the drop down its not getting updated but the Text is added to the Table were i linked this combo Box ..

Find below the code for Reference... Is there any thing i have to add



Private Sub Combo18_NotInList(NewData As String, Response As Integer)
Answer = MsgBox(" Name you have Enterd is not in the List?", vbYesNo, "Not In List")
If Answer = vbYes Then
NameArray = Split(NewData, " ")
FirstName = NameArray(0)
LastName = NameArray(1)

sqlstmt = " INSERT INTO Name ( [First Name], [Last Name] ) VALUES ( ' " & FirstName & " ' , ' " & LastName & " ')"
DoCmd.RunSQL sqlstmt
Response = acDataAdded
'Response =

Else
Responce = acDataAdded
End If


End Sub