totn Access

MS Access 2013: Populate underlying table when new entries are keyed into combo box

This MSAccess tutorial explains how to populate an underlying table when new entries are keyed into a combo box in Access 2013 (with screenshots).

Question: In Microsoft Access 2013, I have a form that is bound to a table. I have created a combo box on this form that obtains its values from a field that resides in a different table from the one that the form is bound to. When I enter values in this combo box I want those values written back to the associated field. How do I setup the combo box so that entries in the combo box are written back to the field in the table it came from?

Answer: We've provided a download to demonstrate how to code a combo box so that whenever you enter a value in a combo box that is not in the list of values, you can have the value added to the underlying table.

Download version in Access 2013

Let's look at the example. Below is a form that contains a combo box called Task.

Microsoft Access

When a new value is entered in the Task combo box that is not in the list of values and you tab off, the following window will appear. In our example, we've entered the task called "Test".

Microsoft Access

If you select Yes, the task called "Test" will be saved to the underlying table and will now appear in the combo box.

Please note: If you try applying this technique to your own database and you receive a database variable "not defined" error, you can fix this problem by going to our associated page.