Hello,
I need to assign 6 different purposes (in the future even more) to 1 button.
The thing I want to do is export a pivot from access to excel by pressing on that button.
When I choose an option from my dropdownmenu, the chosen option gets shown as a pivot in my subform:
Private Sub Soort_Rapport_AfterUpdate()
Select Case Soort_Rapport
Case 1
Me.Sub21.SourceObject = "pivot_data_rapport_1"
Case 2
Me.Sub21.SourceObject = "pivot_data_rapport_2"
Case 3
Me.Sub21.SourceObject = "pivot_data_rapport_3"
Case 4
Me.Sub21.SourceObject = "pivot_data_rapport_4"
Case 5
Me.Sub21.SourceObject = "pivot_data_rapport_5"
Case 6
Me.Sub21.SourceObject = "pivot_data_rapport_6"
Case Else
Me.Sub21.SourceObject = ""
End Select
End Sub
Now I want this button to export it to excel.
I've made a macro in Access that can process 1 pivot.
So instead of making 6 different buttons I want 1 to do the job for all of them.
Can somebody help me out? I'm kinda stuck on this
.
Many Thanks!
I need to assign 6 different purposes (in the future even more) to 1 button.
The thing I want to do is export a pivot from access to excel by pressing on that button.
When I choose an option from my dropdownmenu, the chosen option gets shown as a pivot in my subform:
Private Sub Soort_Rapport_AfterUpdate()
Select Case Soort_Rapport
Case 1
Me.Sub21.SourceObject = "pivot_data_rapport_1"
Case 2
Me.Sub21.SourceObject = "pivot_data_rapport_2"
Case 3
Me.Sub21.SourceObject = "pivot_data_rapport_3"
Case 4
Me.Sub21.SourceObject = "pivot_data_rapport_4"
Case 5
Me.Sub21.SourceObject = "pivot_data_rapport_5"
Case 6
Me.Sub21.SourceObject = "pivot_data_rapport_6"
Case Else
Me.Sub21.SourceObject = ""
End Select
End Sub
Now I want this button to export it to excel.
I've made a macro in Access that can process 1 pivot.
So instead of making 6 different buttons I want 1 to do the job for all of them.
Can somebody help me out? I'm kinda stuck on this
Many Thanks!