Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Make New Entries in Combobox Feilds enter Look Up List Automati

Status
Not open for further replies.

number2

Technical User
Oct 25, 2001
284
US
I currently have the combobox move the user to a form to enter a new contact if the users information is not in the lookup table. I use the OnNotInList Event listed below.
What I would like to do is have the information AUTOMATICALLY entered so the user does not have to go to a separate form to enter a new contact

Private Sub Carrier_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_Carrier_NotInList

Dim intAnswer As Integer

intAnswer = MsgBox("That Insurance Carrier is not Listed in the Lookup List. Please add it to the List, then Select it from the Drop Down List", vbYesNo, vbQuestion)
If intAnswer = vbYes Then
DoCmd.RunCommand acCmdUndo
DoCmd.OpenForm "Insurance Lookup", acNormal, , , acFormEdit, acDialog
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If

Exit_Carrier_NotInList:
Exit Sub

Err_Carrier_NotInList:
MsgBox Err.Description
Resume Exit_Carrier_NotInList
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top