List access objects in a combo box

  • Thread starter Thread starter PJFry
  • Start date Start date
Is there a way to populate a combo box with the tables names in the database?

Clunky and undocumented: set its Rowsource to

SELECT MSysObjects.Name
FROM MSysObjects
WHERE ((([Flags] And 2)=0) AND ((MSysObjects.Type)=1))
ORDER BY MSysObjects.Name;

This works in 2003, no guarantees for other versions and I'm not altogether
comforatable with the Flags criterion either.

John W. Vinson [MVP]
 
Worked well. Thanks.

I tend to be on the clunk side of coding these days, so it is a good match!

What do the Flags mean?

John W. Vinson said:
Is there a way to populate a combo box with the tables names in the database?

Clunky and undocumented: set its Rowsource to

SELECT MSysObjects.Name
FROM MSysObjects
WHERE ((([Flags] And 2)=0) AND ((MSysObjects.Type)=1))
ORDER BY MSysObjects.Name;

This works in 2003, no guarantees for other versions and I'm not altogether
comforatable with the Flags criterion either.

John W. Vinson [MVP]
 
Worked well. Thanks.

I tend to be on the clunk side of coding these days, so it is a good match!

What do the Flags mean?

That's one of the many undocumented aspects of these undocumented system
tables. Apparently from inspection of the tables, it's a bitmapped Long
Integer in which the 2's bit means it's a system table. The tables in the
database I tried all had 0 for tables I'd created, and 2 or other (huge) even
values for all the system tables.

John W. Vinson [MVP]
 
Back
Top