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.
> 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