Dynamic Report Label Captions

Monsora83

Registered User.
Local time
Today, 02:01
Joined
May 16, 2011
Messages
41
I have been using this line of code to dynamically update label captions for my database.

Forms(strFormID).Controls(strLabelID).Properties("Caption").Value = strlabelcaption

And I was curious if the same could be done for reports as well. I figured one way to est would to use the code below, but it didn't seem to work. Any pointers would be appriciated, thanks.

Reports(strReportName).Controls(strReportLabelID).Properties("Caption").Value = strlabelcaption
 
It can probably work, but the place to do it is the report's open event.
 
It can probably work, but the place to do it is the report's open event.

I should clearify, I am trying to use it, along with the reports open event, but nothing happens. The form opens, no errors given, but the caption is not changed.
 
Don't know what to tell you without seeing your actual code. This just worked in a brief test:

Code:
Private Sub Report_Open(Cancel As Integer)
  Me.Label25.Caption = "Test caption here"
End Sub
 

Users who are viewing this thread

Back
Top Bottom