While all of this is very nice, the question remains. Why do you need the combo box to dropdown on form load? That just doesn't make any sense to me. That would really annoy me as a user.
For most situations, I think you are right that it would be an annoyance to have the combo box dropdown on form load. But in this case, the combo box is on a form (named “frmInsCoAddEdit”) that is used for only one of two purposes: (1) to add a new insurance company name to a table of names, or (2) to edit the name of an insurance company already in the table. The form is opened by a command button captioned: “Add/Edit Ins Co”. The only reason for activating the button (and thus opening the form) is to do one of those two actions.
Once the form is open, the label next to the combo box explains what to do: ” ENTER new company or SELECT company to EDIT from list”
Since a combo box combines the features of a text box with those of a list box, the user can either immediately start typing the name of a new company into the text box portion of the combo box, or s/he can select an existing name from the list portion of the combo box (which is why I want it to dropdown when the form loads). Then as soon as you leave the box, the list portion closes thus making more space available on the form to see other controls.
Code in the After Update event of the combo box tests to see if a new name was added in the text box portion of the combo, or if an existing name was selected from the list. If a new name was entered, then the code line
DoCmd.RunCommand acCmdRecordsGoToNew sets up a text box bound to the table of insurance company names (txtInsName) for entering a new record. But if an existing name is selected from the list, then the code puts that name into txtInsName and unlocks it for editing. In other words, depending on the action done in the combo box, the form is either set up to add a new record or to edit an existing one.
I also thought about other alternatives such as having two buttons – one for adding a name and one for editing an existing name. Or, I could have put an Option Group on the Add/Edit form to choose between adding a new record or editing an existing one. But that just adds the step of selecting an action before getting to the primary purpose of the form – adding or editing a name.
It all seems pretty efficient to me. The form opens, I either enter a new name or select an existing one, and the code in AfterUpdate then sets up the form for adding or editing depending on the action that I did in the combo box.