By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,222 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,222 IT Pros & Developers. It's quick & easy.

displaying table names based on tabledef properties

P: n/a
I'm building a form that lets users manage the app's lookup tables by
adding and (maybe) removing values that show up in various combo boxes
across the application.

The original idea was to show a datasheet listing the names of all the
lookup tables available to the user. The user would select one of the
names, and then be taken to a screen where the selected table's data
could be worked on.

I added a property called "lookup" to all tabledefs in the db. My plan
was to traverse the tabledefs collection and show the user the names
of tables whose lookup property is set to true. Now I realize I have
no idea how to do this.

Can someone point me in the right direction? Or is there a better way
to go about this? In the past I've used naming conventions to find all
my lookup tables in a query, but that would mean renaming a bunch of
tables which I'd rather not do.

Thanks for any help,
-- S
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Perhaps this (in Debug window):

? CurrentDB.TableDefs("table_name").Properties("look up").Name

If you get "lookup" as the result that means there is a property named
"lookup."

Loop 'de loop (untested):

dim td as tabledef
dim prp as property

for each td in currentdb.tabledefs
for each prp in currentdb.tabledefs(td.name).Properties
if prp.name = "lookup" then debug.print td.name
next prp
next td

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQSKH74echKqOuFEgEQLckwCgjwRgtiQUnUZdBF7BQBKN/qJTAwUAoIRF
UYBN9mqkwu3X609kEmUj2i6X
=PczP
-----END PGP SIGNATURE-----
shunah wrote:
I'm building a form that lets users manage the app's lookup tables by
adding and (maybe) removing values that show up in various combo boxes
across the application.

The original idea was to show a datasheet listing the names of all the
lookup tables available to the user. The user would select one of the
names, and then be taken to a screen where the selected table's data
could be worked on.

I added a property called "lookup" to all tabledefs in the db. My plan
was to traverse the tabledefs collection and show the user the names
of tables whose lookup property is set to true. Now I realize I have
no idea how to do this.

Can someone point me in the right direction? Or is there a better way
to go about this? In the past I've used naming conventions to find all
my lookup tables in a query, but that would mean renaming a bunch of
tables which I'd rather not do.


Nov 13 '05 #2

P: n/a
Thanks MG. I was actually wondering how to fill a form's recordset
with those tabledef names. But I think it's easier just to make a
table with the names of the tables I want and run a query off of that.

-- Sharon
MGFoster <me@privacy.com> wrote in message news:<2K*******************@newsread1.news.pas.ear thlink.net>...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Perhaps this (in Debug window):

? CurrentDB.TableDefs("table_name").Properties("look up").Name

If you get "lookup" as the result that means there is a property named
"lookup."

Loop 'de loop (untested):

dim td as tabledef
dim prp as property

for each td in currentdb.tabledefs
for each prp in currentdb.tabledefs(td.name).Properties
if prp.name = "lookup" then debug.print td.name
next prp
next td

--

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.