Table object properties

  • Thread starter Thread starter Warrio
  • Start date Start date
W

Warrio

Hello!

Is it possible to get by code the value entered in an Access Table object?
(The value you enter by right clicking on a table and then on Properties)

I tried this but with no success:

MsgBox CurrentData.AllTables("myTable").Properties

Thanks for any suggestion.
 
Warrio said:
Is it possible to get by code the value entered in an Access Table object?
(The value you enter by right clicking on a table and then on Properties)

I tried this but with no success:

MsgBox CurrentData.AllTables("myTable").Properties


If there is a way, I haven't figured it out.

I've always use DAO through the TableDefs collection:

Public Sub ListTdfProps(strTblName As String)
Dim db As Database
Dim tdf As TableDef
Dim prp As Property

Set db = CurrentDb()
Set tdf = db.TableDefs(strTblName)
For Each prp In tdf.Properties
Debug.Print prp.Name, prp.Value
Next prp
 
'Properties' is not a single thing. It is rather a collection of all of the
properties associated with that table. You have to either ask to see the
value of a specific property (as in MsgBox
CurrentData.AllTables("myTable").Properties("Type")-
although this will probably show you a message box with the number '0' in
it) or walk through the whole set using a for each loop (easiest).
 
Thanks for your help, but did you try the code you suggest me?
I typed :
CurrentData.AllTables("myTable").Properties("Type")

and I have the following error:
Err2467: "The expression you entered refers to an object that is closed
or doesn't exist."
 
Thanks! it's the not the same way, but the result is the one that I was
looked for!
it works perfectly!! thanks again
 
One other thing- if you open the Locals window and expand everything until
you come to the several referneces to Properties, they all- every single
instance- display the text "<The expression you entered refers to an object
that is closed or doesn't exist>"

It certainly seems that Marshall's observation is right: Can't get there
from here.

I tried breaking it down into several levels: a CurrentData object, an
AccessObject for the table, an AccessObjectProperties object for the
Properties, and an AccessObjectProperty for a specific property. It always
issued the above when I tried to set the AccessObjectProperties object.
 
Yes I did, but it seems that my posts are out of order. My second post (which
appears (at least in my news reader) as my first post) says that indeed, it
appears that ADO can't do this, as Marshall pointed out.
 
Back
Top