Populate table field names in a dropdown menu in VBA

Populate table field names in a dropdown menu in VBA

This might be handy for you if you are trying to have a drop down menu which populates the tables that are available in the access file and upon selecting a table, the fields of the selected table are populated.

This is the screenshot of my form:

List of tables and fields

These are the steps you would need to take:

Step 1:

Upon opening the form, the first thing it will do is call Form_Open

In step 2 you will see what Form_Open is like

Step 2:

Step 3:

This function will capture selected table and field names

We’re using an array because when we’re calling a function we want two values returned, instead of one.

Step 4. How to call that function

Step 5:

That is all folks.

Please comment if have questions, or more clarification is needed

 

Leave a Reply