Using DoCmd to open query as PivotTable?

Repent

Registered User.
Local time
, 21:30
Joined
Apr 10, 2008
Messages
108
I have created code to use the DoCmd to open reports nad queries in datasheet form. I have a query that opens in pivot table form.

What DoCmd syntax would I use to open a query in PT form?

Here is the code I've used with the DoCmd to open queries and reports. Cannot figure out how to get queries to open in PT form though.

Code:
Private Sub Combo0_AfterUpdate()
  Dim strFormName As String
    strFormName = Me.Combo0
    DoCmd.OpenQuery strFormName, acViewNormal
    
End Sub

Any help is appreciated.
 
Ok so now I'm really stumped. The error I keep getting is "Abacus can't find the object '1'." So I changed the last line of code to "DoCmd.OpenQuery "qryProductionNumbers", AcViewPivotTable
so the specific form is named and it opens like I want it to.

Why in this case do queries and reports open up using strFormName instead of the named report but won't in this case?
 
Got it figured out.
 

Users who are viewing this thread

Back
Top Bottom