Pivot table default view

G

Guest

Hi,
I have a pivot table which displays some handy statistics on my database. I
have linked this table to a button on a form which opens the pivot table.
The trouble is when I click the button the form opens in form view and not
pivot table view. I have set it's properties to have the tables default view
as PivotTable and I have prevented the form from opening in any other view
with the 'allow design view' properties. This works when I open the form
individually but when it is linked to a button it opens in form view which
doesnt help at all. Is there any other properties or code that I could use?
Thanks for your help.
 
G

Guest

Hi Ben,

I'm no guru and I've been searching for answers to this question myself to
no avail. I was trying to open my Pivot table from the switchboard. I have
managed a work around by making another form which opens from the Switchboard
and then closes itself. In the OnOpen Event I used the following line of code
to successully open the pivot table form in Pivot Table view
DoCmd.OpenForm "NameofPivotTableForm", acFormPivotTable, , stLinkCriteria

I then closed my form with
DoCmd.Close acForm, "ThisForm"

I suspect that the button you are using was probably a wizard version of the
OpenForm and as such would be something like this
DoCmd.OpenForm "NameofPivotTableForm", , , stLinkCriteria

You probably just need to replace this line with my example at the top
(inserting the name of you form) to be successful. I've added the extra
information here with the close form because I needed mine to work from the
switchboard and the information may be useful to someone else. Hope it works
for you.
Cheers
Teewan
 

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