I need to create a combo box on a form from a table.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box on a form from a table "Requestor". This is to select who
requests that a raw material sample is taken. I would like to be able to add
names to the list by entering them on the form instead of opening and
updating the table. I have been told that I might possibly have to use a
OnNotOnList event procedure. but I don't have the faintest idea how to do
that. Could you please help me.
 
Should look something like this:

Private Sub cbomaterial_NotInList(NewData As String, Response As Integer)

On Error GoTo Err_cbomaterial_NotInList

Dim strPrompt As String

strPrompt = "The text you entered is not an item in the list - add it?"
If MsgBox(strPrompt, vbYesNo Or vbQuestion, "Add to List?") = vbYes Then
AddToList NewData, "Material", "Material"
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If

Exit_cbomaterial_NotInList:
Exit Sub

Err_cbomaterial_NotInList:
MsgBox Err.Description
Resume Exit_cbomaterial_NotInList



End Sub
 
Back
Top