Hi I have tried entering the below code which i got from a you tube video on how to do a not in list code to open a form and add the client to the list. the problem is when i type in to the combo box and hit enter it just allows the new info and doesn't add it to my clients table.
Code:
Private Sub Client_Name_NotInList(NewData As String, Response As Integer)
Dim MsgBoxAnswer As Variant
Response = acDataErrContinue
MsgBoxAnswer = MsgBox("Client not in list. Do you want to add this client?", vbYesNo)
If MsgBoxAnswer = vbNo Then
Me.Client_Name = Null
DoCmd.GoToControl "Client_Name"
GoTo exitline
Else
txtHiddenField = "AddOK"
DoCmd.OpenForm ("frmAddClient")
DoCmd.GoToRecord , , acNewRec
Forms![frmNewQuote]![Client_Name] = NewData
Me.Client_Name = Null
DoCmd.GoToControl "Description"
End If
End Sub