dbTalk Databases Forums  

Re: Description Property

comp.database.ms-access comp.database.ms-access


Discuss Re: Description Property in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pieter Linden
 
Posts: n/a

Default Re: Description Property - 08-23-2003 , 11:12 PM






Ira Solomon <isolomon (AT) solomonltd (DOT) com> wrote

Quote:
I want to read the description property for a report (or a form,
table, etc.).

I tried to do it with the Allreports object. I can get the name, the
dates, but I can't get the description.

I was able to do it using a DAO object:

Public Function test()
Dim dbs As DAO.Database
Dim docLoop As Document
Dim i, pcnt As Integer
Set dbs = CurrentDb

With dbs.Containers!Reports

For Each docLoop In .Documents
pcnt = docLoop.Properties.Count
For i = 0 To pcnt - 1
Debug.Print i & " " & docLoop.Properties(i)
Next i
Next docLoop
End With
dbs.Close
End Function

When i is 10 I get the description if the item has one or an error if
it doesn't.

But now I have one peice of DAO surrounded by ADO.
Ira,
I think ADO is a red herring here. If you're playing with properties,
an object may or may not have the property in question. If it
doesn't, your code is going to raise an error. You could use a
function to return the value of the property, and an error number if
one is raised. Then you could respond accordingly. The problem is
that (I think) some properties don't exist unless you explicitly
create them. So this could bomb out a lot more than you'd think.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.