Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / November 2007

Tip: Looking for answers? Try searching our database.

Tables (not their fields) in a "dynamic" list box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
francesco - 03 Nov 2007 00:28 GMT
1. I would like to have a form with a dropdown box listing all the tables in
my database.
2. When a new table is created, it will automatically be added to the list
box.
Are they both possible?
Thank you in advance for your help.
fredg - 03 Nov 2007 01:25 GMT
> 1. I would like to have a form with a dropdown box listing all the tables in
> my database.
> 2. When a new table is created, it will automatically be added to the list
> box.
> Are they both possible?
> Thank you in advance for your help.

As rowsource of a list box or combo box:

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

If you add additional tables, they will be added the next time the
form is opened. If you need to show the table immediately, you need to
requery the combo box:
Me![ComboName].requery

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Douglas J. Steele - 03 Nov 2007 12:19 GMT
>> 1. I would like to have a form with a dropdown box listing all the tables
>> in
[quoted text clipped - 10 lines]
> (((Left([Name],4))<>"MSys") AND ((MSysObjects.Type)=1)) ORDER BY
> MSysObjects.Name;

You might want to include types 4 (tables linked through ODBC) and 6 (other
linked tables) in that query as well.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

francesco - 05 Nov 2007 20:05 GMT
Thank you, Doug. Excellent suggestion.

> >> 1. I would like to have a form with a dropdown box listing all the tables
> >> in
[quoted text clipped - 13 lines]
> You might want to include types 4 (tables linked through ODBC) and 6 (other
> linked tables) in that query as well.
francesco - 05 Nov 2007 20:02 GMT
Fred,
Thank you very much. It does exactly what I was looking for.

> > 1. I would like to have a form with a dropdown box listing all the tables in
> > my database.
[quoted text clipped - 13 lines]
> requery the combo box:
> Me![ComboName].requery
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.