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  

Dynamic report label



 
 
Thread Tools Display Modes
  #1  
Old April 15th, 2010, 04:33 PM posted to microsoft.public.access.reports
Tara
external usenet poster
 
Posts: 269
Default Dynamic report label

I have several reports where the user can change the underlying data source
according to a drop-down list on a form. It works perfectly, but now I need
to also change the report labels to reflect which report was generated.
Here's the code that is used to change the data source for one of the
reports. I'm not sure how to incorporate the change for the label though.

Private Sub Report_Open(Cancel As Integer)

Select Case Forms!frmReportType!cboReport
Case "Original"
Me.RecordSource = "UqryTimeSheet"
Me.OrderBy = "UqryTimeSheet.Program"


Case "Amended"
Me.RecordSource = "UqryTimeSheetAmended"
Me.OrderBy = "UqryTimeSheetAmended.Program"

Case Else
MsgBox "Please contact the database administrator for assistance"
End Select

End Sub

Thanks for any help!



  #2  
Old April 15th, 2010, 05:39 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Dynamic report label

Tara wrote:
I have several reports where the user can change the underlying data source
according to a drop-down list on a form. It works perfectly, but now I need
to also change the report labels to reflect which report was generated.
Here's the code that is used to change the data source for one of the
reports. I'm not sure how to incorporate the change for the label though.

Private Sub Report_Open(Cancel As Integer)

Select Case Forms!frmReportType!cboReport
Case "Original"
Me.RecordSource = "UqryTimeSheet"
Me.OrderBy = "UqryTimeSheet.Program"


Case "Amended"
Me.RecordSource = "UqryTimeSheetAmended"
Me.OrderBy = "UqryTimeSheetAmended.Program"

Case Else


Just add lines like:
Me.label.Caption = "something"
to each case.

--
Marsh
MVP [MS Access]
 




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 07:52 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.