Row Source of a ComboBox

  • Thread starter Thread starter Ayo
  • Start date Start date
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
 
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
 
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
 
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.
 
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?
 
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.
 
Back
Top