Log in

View Full Version : List of Tables



jmentor
02-12-2006, 03:17 AM
I need to populate a combo box
with a list of table names and then
add prefix of my choosing to all of
them. Can this be done with a few
lines of code ?

Thank you

TonyJollans
02-12-2006, 04:21 AM
Probably - perhaps with one Select statement. It rather depends on where the table names are to start with and/or what logic is needed to get hold of them.

jmentor
02-12-2006, 06:14 AM
Hi Tony

What about just a list of tables in a combo box
to make it easier.

J

geekgirlau
02-12-2006, 07:11 AM
Actually you don't need code for this. Set the Row Source for the combo box to

SELECT "Prefix" & [Name] AS TableName
FROM MSysObjects
WHERE ((MSysObjects.Type=1) AND (Left([Name],4)<>"msys"))

TonyJollans
02-12-2006, 07:22 AM
What I was trying to ask jmentor was, did he want a list of all tables in his database or something else.

If it's all the tables, there's the answer. Thanks.

jmentor
02-12-2006, 07:42 AM
geekgirlau

Thats even better. Brilliant. No code at all.

Thanks