473,587 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generate a list of objects on a report and select properties

44 New Member
Hi,

I've made a mess of a report. I need to do some cleanup and I need a utility to help me look at all the objects on the report.

I used to have some code for listing all the objects on a report and selectively list properties of that report. I cannot find the code and I am unable to find the posting that provided it.

can anyone help me out?

Basically, I want to pass a report name to a function, and return all the objects on that report and specific property values for each of those objects.

Thanks!
Oct 9 '08 #1
4 1700
ADezii
8,834 Recognized Expert Expert
I wrote this code minutes before going to bed, it can easily be incorporated into a Function:
Expand|Select|Wrap|Line Numbers
  1. On Error Resume Next
  2.  
  3. Dim ctl As Control
  4. Dim rpt As Report
  5. Dim prp As Property
  6.  
  7. DoCmd.OpenReport "rptEmployees2", acViewDesign, , , acHidden
  8.  
  9. Set rpt = Reports("rptEmployees2")
  10.  
  11. For Each ctl In rpt.Controls
  12.   Debug.Print ctl.Name
  13.     For Each prp In ctl.Properties
  14.       Debug.Print "  |-- " & prp.Name & " ==> " & prp.Value
  15.     Next
  16. Next
Sample OUTPUT:
Expand|Select|Wrap|Line Numbers
  1. FirstName
  2.   |-- EventProcPrefix ==> FirstName
  3.   |-- Name ==> FirstName
  4.   |-- ControlType ==> 109
  5.   |-- ControlSource ==> FirstName
  6.   |-- Format ==> 
  7.   |-- DecimalPlaces ==> 255
  8.   |-- InputMask ==> 
  9.   |-- Visible ==> True
  10.   |-- Vertical ==> False
  11.   |-- HideDuplicates ==> False
  12.   |-- CanGrow ==> False
  13.   |-- CanShrink ==> False
  14.   |-- RunningSum ==> 0
  15.   |-- Left ==> 3180
  16.   |-- Top ==> 60
  17.   |-- Width ==> 1170
  18.   |-- Height ==> 270
  19.   |-- BackStyle ==> 0
  20.   |-- BackColor ==> 16777215
  21.   |-- SpecialEffect ==> 0
  22.   |-- BorderStyle ==> 0
  23.   |-- OldBorderStyle ==> 0
  24.   |-- BorderColor ==> 0
  25.   |-- BorderWidth ==> 0
  26.   |-- BorderLineStyle ==> 0
  27.   |-- ForeColor ==> 0
  28.   |-- FontName ==> Arial
  29.   |-- FontSize ==> 8
  30.   |-- FontWeight ==> 400
  31.   |-- FontItalic ==> False
  32.   |-- FontUnderline ==> False
  33.   |-- TextFontCharSet ==> 0
  34.   |-- TextAlign ==> 0
  35.   |-- FontBold ==> 0
  36.   |-- ShortcutMenuBar ==> 
  37.   |-- Section ==> 0
  38.   |-- Tag ==> 
  39.   |-- InSelection ==> False
  40.   |-- LeftMargin ==> 0
  41.   |-- TopMargin ==> 0
  42.   |-- RightMargin ==> 0
  43.   |-- BottomMargin ==> 0
  44.   |-- LineSpacing ==> 0
  45.   |-- IsHyperlink ==> False
  46. Text7
  47.   |-- EventProcPrefix ==> Text7
  48.   |-- Name ==> Text7
  49.   |-- ControlType ==> 109
  50.   |-- ControlSource ==> =Now()
  51.   |-- Format ==> Long Date
  52.   |-- DecimalPlaces ==> 255
  53.   |-- InputMask ==> 
  54.   |-- Visible ==> True
  55.   |-- Vertical ==> False
  56.   |-- HideDuplicates ==> False
  57.   |-- CanGrow ==> False
  58.   |-- CanShrink ==> False
  59.   |-- RunningSum ==> 0
  60.   |-- Left ==> 60
  61.   |-- Top ==> 240
  62.   |-- Width ==> 4560
  63.   |-- Height ==> 300
  64.   |-- BackStyle ==> 0
  65.   |-- BackColor ==> 16777215
  66.   |-- SpecialEffect ==> 0
  67.   |-- BorderStyle ==> 0
  68.   |-- OldBorderStyle ==> 0
  69.   |-- BorderColor ==> 0
  70.   |-- BorderWidth ==> 0
  71.   |-- BorderLineStyle ==> 0
  72.   |-- ForeColor ==> 8388608
  73.   |-- FontName ==> Times New Roman
  74.   |-- FontSize ==> 9
  75.   |-- FontWeight ==> 700
  76.   |-- FontItalic ==> True
  77.   |-- FontUnderline ==> False
  78.   |-- TextFontCharSet ==> 0
  79.   |-- TextAlign ==> 1
  80.   |-- FontBold ==> 1
  81.   |-- ShortcutMenuBar ==> 
  82.   |-- Section ==> 4
  83.   |-- Tag ==> 
  84.   |-- InSelection ==> False
  85.   |-- LeftMargin ==> 0
  86.   |-- TopMargin ==> 0
  87.   |-- RightMargin ==> 0
  88.   |-- BottomMargin ==> 0
  89.   |-- LineSpacing ==> 0
  90.   |-- IsHyperlink ==> False
  91. Text8
  92.   |-- EventProcPrefix ==> Text8
  93.   |-- Name ==> Text8
  94.   |-- ControlType ==> 109
  95.   |-- ControlSource ==> ="Page " & [Page] & " of " & [Pages]
  96.   |-- Format ==> 
  97.   |-- DecimalPlaces ==> 255
  98.   |-- InputMask ==> 
  99.   |-- Visible ==> True
  100.   |-- Vertical ==> False
  101.   |-- HideDuplicates ==> False
  102.   |-- CanGrow ==> False
  103.   |-- CanShrink ==> False
  104.   |-- RunningSum ==> 0
  105.   |-- Left ==> 4740
  106.   |-- Top ==> 240
  107.   |-- Width ==> 4560
  108.   |-- Height ==> 300
  109.   |-- BackStyle ==> 0
  110.   |-- BackColor ==> 16777215
  111.   |-- SpecialEffect ==> 0
  112.   |-- BorderStyle ==> 0
  113.   |-- OldBorderStyle ==> 0
  114.   |-- BorderColor ==> 0
  115.   |-- BorderWidth ==> 0
  116.   |-- BorderLineStyle ==> 0
  117.   |-- ForeColor ==> 8388608
  118.   |-- FontName ==> Times New Roman
  119.   |-- FontSize ==> 9
  120.   |-- FontWeight ==> 700
  121.   |-- FontItalic ==> True
  122.   |-- FontUnderline ==> False
  123.   |-- TextFontCharSet ==> 0
  124.   |-- TextAlign ==> 3
  125.   |-- FontBold ==> 1
  126.   |-- ShortcutMenuBar ==> 
  127.   |-- Section ==> 4
  128.   |-- Tag ==> 
  129.   |-- InSelection ==> False
  130.   |-- LeftMargin ==> 0
  131.   |-- TopMargin ==> 0
  132.   |-- RightMargin ==> 0
  133.   |-- BottomMargin ==> 0
  134.   |-- LineSpacing ==> 0
  135.   |-- IsHyperlink ==> 0
Oct 10 '08 #2
ADezii
8,834 Recognized Expert Expert
Oops, forgot to Close the Report after interrogating it. Add this single line of code after the last line (#16):
Expand|Select|Wrap|Line Numbers
  1. DoCmd.Close acReport, "rptEmployees2", acSaveNo
Oct 10 '08 #3
NJonge01
44 New Member
Thanks! That is just what I needed.

I just pulled the code into a function and passed it my report name. instead of debug.print... I passed the string to a generic function I have for appending to a table.
Oct 14 '08 #4
ADezii
8,834 Recognized Expert Expert
Thanks! That is just what I needed.

I just pulled the code into a function and passed it my report name. instead of debug.print... I passed the string to a generic function I have for appending to a table.
Glad you got what you asked for.
Oct 14 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3587
by: Mike Wiseley | last post by:
I would like to be able to loop through all the report objects in the database and show the recordsource for each and every report, even if the report is not actively open. If I know in advance of this analysis that I all of my reports have queries that start with "qry" I can use the code below. I wonder if there is a way to do this code if the queries could have several naming conventions (or no convention at all). Here is my code for...
1
2762
by: Melissa Kay Beeline | last post by:
OK, here's the sitch : we have an access control system at work that registers ever entry/exit of every employee. I recently made some queries in Access so the ppl in HR could make reports (who came in late, how many ppl were undertimed, etc etc) Now they are not satisfied (of course) and they want a list of ABSENT employees. I have the following tables : PERSONNEL CARD
5
2586
by: Rolan | last post by:
I have tried many iterations of constructing an expanded string link criteria for a list box selection, but have not been successful. The List Box uses a Totals Select Query that has a CustID, Customer Name, Invoice Date and Invoice Amount. There is no InvoiceID/number, otherwise it would be easy to resolve. Currently, I must use a parameter query to key in the invoice date in order to preview/print an invoice from the Invoice Dialog...
35
3562
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is to management theses :-((( I must to declare and use all variable with this scheme :
2
8187
by: Martin Widmer | last post by:
Hi guys I am looking for the best way to generate new reports with reporting services for SQL server 2005. The reports will be generated programmatically from a .Net VB application. So far I see the only way to do it is to feature my objects (text blocks, pictures, tables drawn from excel and databases etc.) with a "render to RDL"- function and thus create an RDL definition of the report, then push that one to the server using the...
8
13373
by: mortb | last post by:
Hi, How do I write a GenerateHashcode function that will generate guaranteed unique hashcodes for my classes? cheers, mortb
0
2248
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional assistance. I say additional because I've already had help which is greatly appreciated. I do try to take the time and understand the provided script in hopes on not having to trouble others on those. But here it goes...
2
1840
by: herbiegrey | last post by:
Hello This is my first post on the forum so hello everyone. I have a problem with access that I can't manage to view the current form record as a report ready to be printed. I have a list of clients that when viewed in a form, i need to be able to generate a letter with their details already filled in. I've tried various version of the same code to try to achieve this, but all it can do is pull out and fill in the report for the...
17
3124
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note that I am using Allen Browne's multi-select list box for a report as a guide. I should also note that my access skills are not the best so I may need some explaining on certain things. First let me give some background on the database: I have a...
0
7857
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8352
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7981
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8222
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5723
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2367
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1457
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1194
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.