Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign Purpose to Button

Status
Not open for further replies.

DJKarel

Technical User
Mar 12, 2007
2
NL
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!
 
already solved this one via a case statement
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top