databaseformsms-accessms-access-2010auto-populate

MSAccess populate multiple fields with a single pulldown


Challenge: I've created a simple repository in MSACCESS (#1) that displays one or more owners of a corporate server.

enter image description here

The sub-form "asset-owners" is linked to the corp-assets main-form (#2). I've added a pulldown whereby the user can select a name (#3) from the address_book (#4) table and prepopulate the owners sub-form.

Objective: I would like to auto populate the associated "Occupation", "Favorite Food", and "Favorite Movie" fields when the user selects a name from the pulldown (#5).

enter image description here

I am not exactly sure how I should configure the occupation food and movie fields to auto-populate with such data AFTER the user has selected the name. I was thinking an inline query for each field, but I suspect it may be simpler than that.

Note: occupation, food, and movie data comes from the address_book (#4).

Many thanks!


Solution

  • I hope you don't want to repeat data in another table. If you just want to display the related data, options:

    1. create multi-column combobox then expression in textbox references combobox column by index - index begins with 0 =[comboboxname].Column(1)

    2. include lookup table in form RecordSource and bind textboxes to fields - set them Locked Yes and TabStop No

    3. DLookup() expression in textbox.