Populating Combo Box With DB Objects

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

Access 2007 sp2.

I want to populate a combo box with Database objects and have that object
open when
selected in the combo box. I'm not sure where to begin.
For instance, I want to populate a combo box with the tables from my back
end db
and when I select one have the table open.

Thanks,
James
 
I've found via google the following in the row source of the combo box
displays my back end db tables:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE ((Left([name],4)<>"MSys") AND ((MSysObjects.Type)=6))
ORDER BY MSysObjects.Name;

I'm just not sure now what to put in the After Update of the combo box tho
open the selected table.

James
 
I've found via google the following in the row source of the combo box
displays my back end db tables:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE ((Left([name],4)<>"MSys") AND ((MSysObjects.Type)=6))
ORDER BY MSysObjects.Name;

I'm just not sure now what to put in the After Update of the combo box tho
open the selected table.

James

JamesJ said:
Access 2007 sp2.

I want to populate a combo box with Database objects and have that object
open when
selected in the combo box. I'm not sure where to begin.
For instance, I want to populate a combo box with the tables from my back
end db
and when I select one have the table open.

Thanks,
James

DoCmd.OpenTable Me.[ComboBoxName]

Change ComboBoxName to the actual name of your combo box.

Note: while the above will open the selected table, it's not a good
idea to allow users access to tables. Tables are for storing data, not
for user viewing or editing.
 
Understood.
Didn't realize it would be so easy.

Thanks,
James

fredg said:
I've found via google the following in the row source of the combo box
displays my back end db tables:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE ((Left([name],4)<>"MSys") AND ((MSysObjects.Type)=6))
ORDER BY MSysObjects.Name;

I'm just not sure now what to put in the After Update of the combo box
tho
open the selected table.

James

JamesJ said:
Access 2007 sp2.

I want to populate a combo box with Database objects and have that
object
open when
selected in the combo box. I'm not sure where to begin.
For instance, I want to populate a combo box with the tables from my
back
end db
and when I select one have the table open.

Thanks,
James



Change ComboBoxName to the actual name of your combo box.

Note: while the above will open the selected table, it's not a good
idea to allow users access to tables. Tables are for storing data, not
for user viewing or editing.
 
Back
Top