473,387 Members | 1,493 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,387 software developers and data experts.

Generate a list of objects on a report and select properties

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 1684
ADezii
8,834 Expert 8TB
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 Expert 8TB
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
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 Expert 8TB
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
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...
1
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...
5
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,...
35
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...
2
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...
8
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
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...
2
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...
17
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...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.