Trying to change report title during report open event

G

Guest

I am trying to change the title of the report depending on the button used to
choose the report. Here is the code:

Private Sub Report_Open(Cancel As Integer)

Dim x As Integer
Dim base_title As String

base_title = "Comerica Continuous Audit Idea Status Report"

x = Forms!SFRMCA_SELECT_STATUS_RPT.ST_R_FLAG

Debug.Print x
Debug.Print base_title

Select Case x
Case 1
Me.Label34 = base_title & " - Active"
Case 2
Me.Label34 = base_title & " - Implmented"
Case 3
Me.Label34 = base_title & " - Rejected"
End Select

End Sub


When I try to run, I get a "Cannont assign value to this object error on the
Case 1 statement (which is the correct statement). I don't understand why I
can't, this is an unbound object.
 
D

Duane Hookom

Place the code in the On Format event of the section of the report that
contains Label34.
 
G

Guest

As I was driving home, I figured that I was trying to change the value of the
header to early. Thanks Duane
 

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