I have a combo control where I want to let the user add selections.
The combo is bound to a table, and has the property set to limit to list.
I get a notice after putting in a word that I have put something not in the list, and when I go to put the form into design view, again it tells me it's not in the list, and then tells me it cannot be saved at this time. However it has gone into the combo list.
Any ideas please. The combo is on an unbound main form form .
The combo is bound to a table, and has the property set to limit to list.
I get a notice after putting in a word that I have put something not in the list, and when I go to put the form into design view, again it tells me it's not in the list, and then tells me it cannot be saved at this time. However it has gone into the combo list.
Any ideas please. The combo is on an unbound main form form .
Code:
Private Sub Combo867_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database, rst As DAO.Recordset, SQL As String
Response = False
If MsgBox("The item is not in list. Add it?", vbYesNo) = vbYes Then
Set db = CurrentDb()
SQL = "SELECT * FROM Category;"
Set rst = db.OpenRecordset(SQL, dbOpenDynaset)
rst.AddNew
rst![Category] = NewData
rst.Update
Set rst = Nothing
Response = acDataErrAdded
DoEvents
Else
Response = acDataErrContinue
End If
End Sub