Create a combobox that finds records. If you create the combobox when the
Wizards button is depressed in the Toolbox (ie the magic wand button),
Access will start a Wizard to create the combobox and one of the options in
the opening dialog of the Wizard is "Do you want to Find a Record..."
Complete the wizard to create the combobox.
When you select a vendor name in the combobox, that vendor's record will
appear in the the combobox and the form. However, you may need to write some
code to keep your combobox synchronised - ie if you change records other
than by using the combobox (eg you click the Record Navigation buttons at
the bottom of the form), the form may now display one vendor and the
combobox will still be displaying the previous vendor. To overcome this, you
need to write some code for the form's OnCurrent event (which fires when the
form changes records). To do this, open the properties dialog for the form,
click the Events tab, click in the On Current property and click the build
button (with three dots ...) on the right.
The recordset behind the form (and combobox) will need to contain a field
that uniquely identifies each vendor. The code for the OnCurrent event
procedure will be something like:
Me.cboComboBoxName.IDField = Me.IDField
This assumes that the combobox's bound field is the IDField. (Note: the
combobox's name is on the "Other" tab in the properties dialog of the
combobox and I like to use the prefix "cbo".)
Usually, you'd make the IDField the first column in the combobox, make the
first column the bound column, and set its width to zero so that you don't
see it when the form runs. (But you can make any column the bound column and
set any column's width to zero if you want.)
Incidentally, I don't know whether, in your case, you'd be best creating the
combobox in the subform or the main form. I often put such comboboxes in a
main form's header and change the record in the main form.
If none of this makes much sense, you may find the online help topics
useful.
Good luck with your project.
Regards
Geoff