Link to home
Start Free TrialLog in
Avatar of Buck Beasom
Buck BeasomFlag for United States of America

asked on

List Tables in a List Box

How do I list the tables that are in my application in a list box?

Thanks.
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Make this the Row Source of the List Box:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=1))
ORDER BY MSysObjects.Name;

mx
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<*No Points wanted*>
You can revise the SQL MX posted to exclude system tables with something like this:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Type=1 AND Left(MSysObjects.Name,4)<>"msys"
ORDER BY MSysObjects.Name;
Avatar of Buck Beasom

ASKER

Both your solutions were helpful!