|
|
MSAccess Not In List Event Simple VBA code for adding text typed into a combo box |
Private Sub cmbTextToAdd_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
If NewData = "" Then Exit Sub
Set db = CurrentDb
Set rs = db.OpenRecordset("tblTextToAdd", dbOpenDynaset)
rs.AddNew
rs![TextToAdd] = cmbTextToAdd
rs.Update
Response = acDataErrAdded
End Sub
|