-
Select all the details you'll need into the combobox's RowSource (key, forename, surname, etc.)
When I want names in a combobox I usually make the name a concatenation of surname and forname so that it appears in one column rather than two (i.e. SELECT EmployeeID, [Surname] & ", " & [Forename] AS Employee FROM.......) *
Now, that you have all the details you want in the combobox, set it's ColumnCount property to match the number of fields selected in the combo's RowSource.
Then Set the ColumnWidths property to 0;2;0;0;0;0 - for example, where each number represents the field's width in the combo. All widths of 0 are invisible.
Now, in the relevant textbox, set the ControlSource to "calculate" the value based on the combobox.
i.e.
=[MyCombo]
The first Column in a combobox is 0.
Now, when you select anything in your combo, the textbox will update automatically.
* It's a tip not to have SQL in the RowSource of a combo or listbox. Save the SQL that Access may generate as a defined Query. This way it will be compiled and your database won't bloat as much.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules