Sunday, December 31, 2017

Add a combo box to a view in an Access app

Add a combo box to a view in an Access app

Important    Microsoft no longer recommends creating and using Access web apps in SharePoint. As an alternative, consider using Microsoft PowerApps to build no-code business solutions for the web and mobile devices.

In Access web apps, you can use a combo box control so people can choose values from a dropdown list. Using a dropdown list instead of a blank text box makes entering data faster and more accurate.

In the example shown here, clicking in the 2nd Contact combo box control brings up a dropdown list of names.

Combo box in a view

Note: This article doesn't apply to Access desktop databases. For more information about creating controls on forms in desktop databases, see create an Access form.

Note: Combo boxes in Access web apps are limited to displaying 500 items in the dropdown list.

Add a combo box to a view

To add a combo box control, you edit the view in Access and add a comb box control from the Controls gallery.

  1. Start Access, and open the web app.

  2. Click the table caption name in the Table Selector in the left pane, then click the view in the View Selector.

    In the example shown here, Tasks is the table, and List is its view that you'll add the combo box to.

    Tasks table and List view in App design

  3. Click Edit in the middle of the screen to open the view in design mode.

  4. Under View, click Design > Combo Box.

    Combo box control

  5. Move the new combo box to the position you want.

  6. Optionally, add a label control by clicking the label button in the Controls gallery, and move the label next to the combo box. Enter a caption that helps explain the use for the combo box control.

  7. Click the combo box control you added previously on the design grid, and then click the Data icon next to the combo box control to bring up its property options. This is where you'll hook the combo box up to its data source.

    Initial state of property box for a combo list control

  8. To "bind" the combo box to a field (meaning the selected value will be stored in that field), click Control Source, and select the field you want to store the value in.

  9. Click Row Source Type, and select Table/Query. If you choose Value List for the Row Source Type property box instead, you'll have to enter each value you want to display in the Row Source property box on separate lines.

  10. Click Row Source, and select the table or query that contains the values you want to appear in the dropdown list. After you select a table or query here, Access displays additional property options.

  11. In the Bound Field box, select the field that contains the values you want to store from the list. The bound field is the value Access stores in the control source field you defined previously. In some cases this will be the ID value depending upon how you designed your tables and lookup fields. In other cases it might be the values in a specific field. In the Display Field box, select the field that contains the values you want to display from the related table or query. These are the values users will see when using this control in their browser.

    More properties for a combo list control

  12. Click Save on the Quick Access Toolbar to save your view changes.

Set additional options for the combo box

  • In the Default Value box, you can enter a value to be used as the default when a new record is created. If you are using an ID value as the bound field, you'll need to use an appropriate ID value from the related table.

  • In the Popup view box, you can choose a view that "pops up" in a new window if you click the value shown in the combo box in your browser (except in a Datasheet view). When you add a view name as a popup, the display values are formatted like a hyperlink in your browser to show that it's clickable. For example, clicking someone's name in the List view might show a list of all the details for that person – you're loading the List view for that person in a new window. If the view also contains a list of related items, that list also appears in the popup window.

An alternative to a combo box is an autocomplete control, which lets users type one or more characters, showing a list of possible matches as they type. The more characters they enter, the more the list is narrowed down. You might consider using this instead of a combo box if someone already knows the value they're looking for or if you need to read from a source with more than 500 values.

To learn more about autocomplete controls, read adding an autocomplete control to a view in an Access app.

1 comment:

  1. OCMB mobile app
    Get the best online mobile bank at OCMB. Click here to download and register on OCMB Mobile App and use Internet Banking to make money transfers, bills payment, and many more.

    ReplyDelete