0

I am working with a database that has an Excel table.

I created a form and want to populate a listbox with the contents of the linked table when the form loads.

5
  • 1
    Just use the table as row source. What specifically doesn't work? Commented Aug 15, 2018 at 12:00
  • Honestly I'm not sure where to start. I am in just in the beginning stages of learning VBA and have watched a few tutorials but couldn't find anything relevant online. Commented Aug 16, 2018 at 13:50
  • 1
    Okay so I did get it working and can populate the listbox with the table data. I used the following code:. Listbox.rowsource = "SELECT tablename.fieldname FROM tablename" Commented Aug 16, 2018 at 14:59
  • Good! You learn much more by trying things and reading documentation or examples than by asking questions. You can post this as answer, and later accept that answer, to resolve your question. Commented Aug 16, 2018 at 15:44
  • I definitely find that when I have something specific to achieve it helps me learn a language faster. Commented Aug 16, 2018 at 19:12

1 Answer 1

1

Thanks to Andre I found a working solution which is shown below:

Listbox.rowsource = "SELECT tablename.fieldname FROM tablename"

This pulls record(s) from my table and shows them in the listbox. For simplicity sake I only included a single column name but the actual code I used included 4 columns.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.