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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|