open form in pivot table view, from another form

  • Thread starter Thread starter Paul B
  • Start date Start date
P

Paul B

I have a button on a form to open another form, the form is a pivot table,
if I open it from objects, forms it opens in pivot table view, that is the
default, but if I open it from the button on the form it opens it in form
view, the code is below , how can I make it open in pivot table view? Thanks

Private Sub Command8_Click()
On Error GoTo Err_Command8_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmBuildingCostPivotTable"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command8_Click:
Exit Sub

Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click

End Sub
 
Back
Top