Dynamically set caption of label ?

R

Rebecca

I need to set the captions of several label controls for
my report.
Where is the best place to put this? I tried putting it in
the OnOpen event for the report but it does not recognise
the '.caption' property for the label control.
 
L

Larry Linson

I need to set the captions of several
label controls for my report.
Where is the best place to put this?

Put it in the Print event for the Section where the Label resides.
I tried putting it in the OnOpen event
for the report but it does not recognise
the '.caption' property for the label control.

The Open event is too early in the process for setting Controls' properties.

Larry Linson
Microsoft Access MVP
 
R

Rebecca

Ok, I tried both the 'on pageheader format' and 'on print'
events and the caption property does not appear in the VBA
prompt.
This is a label, should I be using a Text Box?
Or, do I have the syntax wrong?
I'm using Me!controlname.caption =
 
L

Larry Linson

I don't understand. For a label named lblA, you would code:

Me!lblA.Caption = "OtherLabel"

in the Print event for that section. It just worked for me. No, Caption
wasn't in the Intellisense list, but it worked just fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top