open form in pivot table view, from another form

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top