Row Source of a ComboBox

A

Ayo

Is there a way to use the list of tables in a database as the Row Source of a
combox ?
Also is there a way to use the list of tabs(worksheets) in a workbork as the
Row Source of a combox ?

Thanks
 
R

Rob Parker

For the tables (excluding the system tables, which you probably don't want,
and normally don't see), use the following query as the Row Source for your
combobox.

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Name Not Like "msys*" AND MSysObjects.Type=1;

Can't help on the second question. But it will be do-able ;-) And it's
likely to depend on how you are accessing the workbook, so you'll probably
need to post some more detail before anyone can help with that.

Rob
 
A

Ayo

Thanks Rob. That was very help full.

Rob Parker said:
For the tables (excluding the system tables, which you probably don't want,
and normally don't see), use the following query as the Row Source for your
combobox.

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Name Not Like "msys*" AND MSysObjects.Type=1;

Can't help on the second question. But it will be do-able ;-) And it's
likely to depend on how you are accessing the workbook, so you'll probably
need to post some more detail before anyone can help with that.

Rob
 
A

Ayo

What I am trying to do is open an excel file and put the tabs of the excel
workbook into a combobox on a form so that users can select the specific tab
that is needed.
 
R

rpw

When and how will the Excel file be accessed? Is the user going to pick out
the file or is there only one file that you will be using? What about
if/when the names or number of tabs change? Or do you simply want to get a
list of the tabs NOW, hard code/enter them into the Row Source for use by the
users LATER?
 
A

Ayo

Thanks.
I was a ble to modify another code to do what I wanted done. The intent was
to open an excel file, minimize it and use the worksheets of the file as a
drop down list in a combobox on my access form.
So everytime I open and excel file, the tab names are listed in the combobox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top