I frequently create a form to add information about an item that would be listed in the dropdown box. For example, if I had a combobox with a list of people, I would create a form specifically to add people and their details. Then using the combobox's OnNotInList event, I would use some VBA code to open the form if the person entered was not in the list. Here's an example:
If MsgBox("Do you want to add a new person to the database?", vbYesNo + vbQuestion, "Question") = vbYes Then
DoCmd.OpenForm "frmAddPerson", _ '<---CHANNGE TO YOUR FORM NAME
Datamode:=acFormAdd, _
WindowMode:=acDialog, _
OpenArgs:=NewData
Response = acDataErrAdded
DoCmd.Close acForm, "frmAddPerson" <--CHANGE TO YOUR FORM NAME
Else
Response = acDataErrContinue
End If
When a user enters a person not in the dropdown list, a message is displayed asking the user if they want to add a new person. If the user clicks {OK} then the form to add a new person opens. After the user enters the details and closes the form, the cursor focus returns back to the combobox and the user resumes entering data on the original form.
Best regards,
Todd
How does one add items to drop down list. have set properties with No to
limit to . list but having problems at setting not In List property. Would
like to see an example as well as explaination.
Thanks