control on form from report

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
 
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



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
 
J

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
 

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