[AccessD] Use of a Variable for Setting Report Properties

Gustav Brock Gustav at cactus.dk
Fri Nov 15 16:12:04 CST 2013


Hi Brad

It is. Turn Str_Test1 etc. into an array, Str_Test.

Then:

For intN = 1 To 20
    Reports("Report" & CStr(intN)).Caption = Str_Test(intN - 1)
Next

/gustav

>>> BradM at blackforestltd.com 15-11-13 22:44 >>>
All,

I have a Four-Week "Calendar" report that has 20 Sub-reports (one for
each "work day" in the 4-week period) 

This application has a little VBA code that changes some of the
properties on each of these 20 reports.

This is done with one line of code for each report like this -

Reports.Report1.Caption = Str_Test1

Reports.Report2.Caption = Str_Test2

Reports.Report3.Caption = Str_Test3 ...



Instead of having one line of code for each report, I would like to set
up a loop to handle this processing.

To do this, I need to somehow use a variable something like...

Reports. & MyVariable & .Caption = Str_Test1

Is this possible?
Thanks,
Brad



More information about the AccessD mailing list