Table description

KenHigg

Registered User
Local time
Today, 05:40
Joined
Jun 9, 2004
Messages
13,327
I looked for something on this without any luck: How do you access (via code), the table description as shown in the database container window?
 
Not sure Ken, but maybe try to navigate the TableDefs collection to find your desired table with corresponding properties.

Hth
 
Thanks rak - I've been tinkering with the object browser and something is leading me to think it's not a tabledef property as all of the objects (forms, reports, etc) have a like description... ?!?
 
ken

try this

Code:
Sub tryit()
Dim prp
Dim dbs As Database
Dim tdf As TableDef

'just the description
    Set dbs = CurrentDb
    Set tdf = dbs.TableDefs("mytable")
    MsgBox (tdf.Properties("description"))

'everything
    For Each prp In tdf.Properties
    MsgBox ("Name: " & prp.Name & "  Value: " & prp.Value)
    Next
End Sub

intersting that defining
dim prp as property produces an error
 
I would have sworn that I tried that - :(

Thanks, just what I needed...
 
it wasnt at all obvious - i kept getting out of scope errors defining

dim prp as property

and there didnt seem to be a help file to show you what properties ARE avaialble, so it was a bit of trial and error.
 
i'm doing something a bit similar myself - spent all day trying to get a utility working to verify that the fields and field types, and indexes and definitions in a client's database agree with my thinking of what they should be, and if not show them the changes required.

even odd bits like allowing zls, not allowing zls are causing issues.- nearly there now anyway
 
I wonder if it's editable from there...?
 
i would think so

i think this is where user definable properties go

you know, with createpropertyy, although I never have.

just try it - something like

tdf.properties("description").value = "new value"
 
So here's the idea. I want to group tables based on what part of the app they support. Say a table may be used for security, another for business data x, etc. Then I want to be able to view and maintain these via a form and even print the list. I'm brainstroming now - Would I need to build a temp table to load them in to be able to have the form and then a mechanism to take any new values from the temp table an put the values back into the properties...? I'd also like to have a comments type area for each table where I could record stuff like changes I may make to the table, etc. Seems I'd need to maintain a permanent table to do something like that...
 
Follow - up:

What about the hidden property? Any idea where it's stored?
 
look at createproperty method, ken

the A97 help (I finf it easier to use) shows the syntax as

Set property = object.CreateProperty (name, type, value, DDL)

Use this to create an extra property called say Behaviour, for each table type.

tHen you can set and use tabledef("behaviour") directly, rather than trying to store it within the description.

Not sure exactly what syntax to use, and I am tied up at the moment

Hope this helps get you started
 
I found it.

GetHiddenAttribute(acTable, "tblName")

Cool - Thanks for helping
 
On to other issues :p

Any suggestion on finding a forms description?
 
Movin right along... :)

In the following code it errors on the 'For Each' line saying 'Object invlaid or no longer set'. Any idea what may be wrong?

Code:
Dim doc As DAO.Document

With CurrentDb.Containers!Forms

 For Each doc In .Documents
   MsgBox "Form " & doc.Name & " - " & doc.Properties("Description")
 Next doc

End With
 
I remember having that error before, I just can't remember what I did to fix that. I think I looped using properties instead of documents, or used a different collection (AllForms collection, for example).
 
I have a work around but this'll kill me 'til I figure it out - :p
 
Sorry. I just decided to screw it and use the workaround. :) I found documents to be kinda quirky.
 

Users who are viewing this thread

Back
Top Bottom