Label Value

D

DS

I need to pull the Value of a Label on a form to a Report. I tried putting
this on the command button of the form after the report opens but it doesn't
work, I assume that its a timing issue, and unlike a textbox there isn't a
control property to put a value in.

Reports!rptCheck!LblDiscount.Caption =
Forms!frmCheckPreview!LblDiscount.Caption

Thanks
DS
 
B

BruceM

Is the label caption created in a way that you cannot reproduce on the
report?
I have not tried what you are asking, but I assuming the form is still open
I expect you could set the label's caption in the Print event of the report
section (e.g. the Detail section's Click event if the label is in the Detail
section):
Me.lblDiscount.Caption = Forms!frmCheckPreview!LblDiscount.Caption.
 
F

fredg

I need to pull the Value of a Label on a form to a Report. I tried putting
this on the command button of the form after the report opens but it doesn't
work, I assume that its a timing issue, and unlike a textbox there isn't a
control property to put a value in.

Reports!rptCheck!LblDiscount.Caption =
Forms!frmCheckPreview!LblDiscount.Caption

Thanks
DS

Work it from the Report end.

Code the Report's Report Header Format event:
Me.[lblDiscount].Caption = Forms!frmCheckPreview!LblDiscount.Caption

The form must be open when the report is run.
 
K

Klatuu

Change the label in the report to a text box.
Put your reference to the form's label in the Control Source of the text box:

=Forms!frmCheckPreview!LblDiscount.Caption
 
D

DS

I made a Text Box with this in the control source.
=[Forms]![frmCheckPreview]![LblDiscount].[Caption]
This works.
The form is closed when the report prints.
Thanks
DS
 
D

DS

The form is closed when the report is run.
Thanks
DS
fredg said:
I need to pull the Value of a Label on a form to a Report. I tried
putting
this on the command button of the form after the report opens but it
doesn't
work, I assume that its a timing issue, and unlike a textbox there isn't
a
control property to put a value in.

Reports!rptCheck!LblDiscount.Caption =
Forms!frmCheckPreview!LblDiscount.Caption

Thanks
DS

Work it from the Report end.

Code the Report's Report Header Format event:
Me.[lblDiscount].Caption = Forms!frmCheckPreview!LblDiscount.Caption

The form must be open when the report is run.
 
L

Larry Linson

DS said:
I made a Text Box with this in the control source.
=[Forms]![frmCheckPreview]![LblDiscount].[Caption]
This works.
The form is closed when the report prints.
Thanks
DS

BruceM said:
Is the label caption created in a way that you cannot reproduce on the
report?
I have not tried what you are asking, but I assuming the form is still
open I expect you could set the label's caption in the Print event of the
report section (e.g. the Detail section's Click event if the label is in
the Detail section):
Me.lblDiscount.Caption = Forms!frmCheckPreview!LblDiscount.Caption.
 

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