Tricks and Tips for Microsoft Access
Private Sub cboSourceCodeTable_NotInList( _
NewData As String, Response As Integer)
On Error Resume Next
Response = acDataErrContinue
If MsgBox("The source code '" & NewData _
& "' is not in the list." _
& vbLf & "Do you wish to add it?", _
vbYesNo) = vbYes Then
CurrentDb().Execute "insert into LeadSourceCode(Description) values ('" _
& NewData & "')"
Response = acDataErrAdded
End If
End Sub
About Steve Gray
Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.