473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Report Description

I am trying to show the description of all the reports in my DB in a query,
whether the report is open or closed.
The following prints the names OK, but when it dets to the line Debug.Print
obj.Properties(1) I get, not unsurprisingly, a message that the report is
not open.

Grateful for any ideas

Thanks
Function GetDesc(RptName As String) As String

Dim obj As AccessObject, dbs As Object

Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
If obj.Name = RptName Then ' Correct report
' Print name of obj.
Debug.Print obj.Name
Debug.Print obj.Properties(1) ' ***** Fails
GetDesc = Obj.Properties(1)
End If
Next obj

End Function
Apr 27 '07 #1
2 3508
You can get the report's Description like this:
Currentdb.Containers!Reports.Documents("Report1"). Properties("Description")

But if the report has no description, that will fail, so you need error
handling.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Phil Stanton" <ph**@stantonfamily.co.ukwrote in message
news:46**********************@ptn-nntp-reader02.plus.net...
>I am trying to show the description of all the reports in my DB in a
query, whether the report is open or closed.
The following prints the names OK, but when it dets to the line
Debug.Print obj.Properties(1) I get, not unsurprisingly, a message that
the report is not open.

Grateful for any ideas

Thanks
Function GetDesc(RptName As String) As String

Dim obj As AccessObject, dbs As Object

Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
If obj.Name = RptName Then ' Correct report
' Print name of obj.
Debug.Print obj.Name
Debug.Print obj.Properties(1) ' ***** Fails
GetDesc = Obj.Properties(1)
End If
Next obj

End Function
Apr 27 '07 #2
Brilliant Allen, works a treat

Thanks

Phil
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:46***********************@per-qv1-newsreader-01.iinet.net.au...
You can get the report's Description like this:

Currentdb.Containers!Reports.Documents("Report1"). Properties("Description")

But if the report has no description, that will fail, so you need error
handling.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Phil Stanton" <ph**@stantonfamily.co.ukwrote in message
news:46**********************@ptn-nntp-reader02.plus.net...
>>I am trying to show the description of all the reports in my DB in a
query, whether the report is open or closed.
The following prints the names OK, but when it dets to the line
Debug.Print obj.Properties(1) I get, not unsurprisingly, a message that
the report is not open.

Grateful for any ideas

Thanks
Function GetDesc(RptName As String) As String

Dim obj As AccessObject, dbs As Object

Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
If obj.Name = RptName Then ' Correct report
' Print name of obj.
Debug.Print obj.Name
Debug.Print obj.Properties(1) ' ***** Fails
GetDesc = Obj.Properties(1)
End If
Next obj

End Function

Apr 27 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David | last post by:
This might be a report question but I think it is more a query issue than a report. I am a novice at bothAccess reporting and queries and have been struggling to build the following. (Note using...
4
by: Sami | last post by:
I hope someone will tell me how to do this without having to do any VB as I know nothing in that area. I am a rank beginner in using Access. I have created a database consisting of student...
1
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals....
5
by: dkelly925 | last post by:
Is there a way to add an If Statement to the following code so if data in a field equals "x" it will launch one report and if it equals "y" it would open another report. Anyone know how to modify...
2
by: rinmanb70 | last post by:
I have a QBF form/query and a report from the QBF that shows the results of the QBF. I would like to show the criteria on the report that was used in the QBF to get the info on report. I can't...
1
by: sonicfun2006 | last post by:
I have SQL Server Database and MS Access 2003 is connected with ODBC. I have very large amount of records in various tables. The database is very dynamic as it changes every minute. I’m trying to...
4
by: Fran | last post by:
I recently tried to use code for "Use a multi-select list box to filter a report" from Allen Browne in my database. I was able to add the code and adapt it to my needs, however I am getting an...
12
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just...
3
by: kstevens | last post by:
I have created a report that looks like a spreadsheet. The only problem is that when one of the cell grows (cangrow property is yes) then the lines beside them are not long enough. I tried this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.