Changing Header Label

J

jutlaux

I have a report "rptStandard" that is filtered by specific criteria buttons
on a form. For example on Form = frmSwitchboard there is a button
cmdOpenReportByStatus with the following code

Private Sub cmdOpenReportByStatus_Click()
On Error GoTo Err_cmdOpenReportByStatus_Click
Dim stDocName As String
Dim strWhere As String
stDocName = "rptStandard"
strWhere = "1=1 "
If Not IsNull(Me.cboProjectStatus) Then
strWhere = strWhere & " And [strProjectStatus]= """ & _
Me.cboProjectStatus & """"
End If
DoCmd.OpenReport stDocName, acPreview, , strWhere

Exit_cmdOpenReportByStatus_Click:
Exit Sub
Err_cmdOpenReportByStatus_Click:
MsgBox Err.Description
Resume Exit_cmdOpenReportByStatus_Click
End Sub

that filters the report by the data selected in cboProjectStatus. What I
have done is in the page header of Report="rptStandard" I created a label
called "lblFilterType" that I would like to display the Filter Type. Meaning
"Filtered By Originator" = cboProjectStatus.value. I tried to code this into
the buttons by adding the following right after the DoCmd.OpenReport

Report.rptStandard.lblFilterType.Caption = "Filtered By Originator = " &
Me.cboProjectStatus

but I keep getting an "Object Required" error.
 

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