Change Report Title Based on Source & Date?

J

Jim

I have a report with the following code behind:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

If Format(Forms!frmCommission!cboStartDate, "mmyyyy") =
Format(Forms!frmCommission!cboEndDate, "mmyyyy") Then

Me.txtTitle = "Commission " & Format(Forms!frmCommission!cboStartDate,
"mmm/yyyy")
Else
Me.txtTitle = "Commission " & _
Forms!frmCommission!cboStartDate & " To " & _
Forms!frmCommission!cboEndDate
End If

End Sub

Private Sub Report_Open(Cancel As Integer)

Select Case Form_frmCommission.optSource

Case 1
Me.RecordSource = "qryCommInvUS"
Case 2
Me.RecordSource = "qryCommInvCanada"
Case Else
MsgBox "Select Report"
End Select

End Sub

I need to change the title of the report to add either Canadian or U.S. to
the title depending on the Record Source, leaving the other criteria in
place at the same time.
Thanks for any help.

Jim
 

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