control on form from report

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a label on a main form. There is a print button on the main
form that opens the report. When the report opens I need for it to
check if a label is visible on the main form and if so display a label
on the report. Below is the what I have in the Report_Open event but
the report label is not showing.

If Forms![Purchase Orders].lblPONotApproved.Visible = True Then
Me.lblPOIsNotApproved.Visible = True
Else
Me.lblPOIsNotApproved.Visible = False
End If

Am I missing something or is there a better way to show the label?

Thanks....John
 
I have a label on a main form.  There is a print button on the main
form that opens the report.  When the report opens I need for it to
check if a label is visible on the main form and if so display a label
on the report.  Below is the what I have in the Report_Open event but
the report label is not showing.

    If Forms![Purchase Orders].lblPONotApproved.Visible = True Then
        Me.lblPOIsNotApproved.Visible = True
    Else
        Me.lblPOIsNotApproved.Visible = False
    End If

Am I missing something or is there a better way to show the label?

Thanks....John



You can disregard this post. I figured it out. The code above is
fine. There was another piece in front of this that needed to be
modified.

Thanks for reviewing...John
 
John said:
I have a label on a main form.  There is a print button on the main
form that opens the report.  When the report opens I need for it to
check if a label is visible on the main form and if so display a label
on the report.  Below is the what I have in the Report_Open event but
the report label is not showing.
   If Forms![Purchase Orders].lblPONotApproved.Visible = True Then
       Me.lblPOIsNotApproved.Visible = True
   Else
       Me.lblPOIsNotApproved.Visible = False
   End If
Am I missing something or is there a better way to show the label?

If it's not too cryptic for your tastes, you can shorten the
code to just one line:

   Me.lblPOIsNotApproved.Visible = Forms![Purchase
Orders].lblPONotApproved.Visible



Nothing is too cryptic. I like the one liner. Thanks.
.... John
 
Back
Top