A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Change Report Title Based on Source & Date?



 
 
Thread Tools Display Modes
  #1  
Old April 23rd, 2010, 09:42 PM posted to microsoft.public.access.reports
Jim
external usenet poster
 
Posts: 39
Default Change Report Title Based on Source & Date?

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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.