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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

graphs and on load event problems

Status
Not open for further replies.

bluesage

Programmer
Apr 27, 2004
26
CH
hi

i made a form, containing a field from a table. i viewed it in pivot chart view and the graph works well.

however, i tried using VBA and in the form load, seting all views to false except the chart view, but doesnt work. it always opens in datasheet view.

can someone show me how to do this? how to set it so when i open the form, it automatically shows the graph.

i want to make a cmd button, which will open this form, and so i want the graph to appear, so that the user (someone who doesnt know the program well) can see the graph and not have to change the view.


thanks
 
Try to open your form like this:
DoCmd.OpenForm "YourForm", acFormPivotChart
You may have to verify that the AllowPivotChartView property is set tot true.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
thanks, the code is useful. it works if i apply it to the on click event of a cmd button. but if simply do this:

Sub Form_Load (Cancel ...)

docmd.openform "formname", acformpivotchart

end sub

it gives me an error message saying:

the view can not be changed at this time


do you know what is wrong?

i would like it to automaticaly open in pivotchart view, and not have to right click each time and say view pivot chart.

thanks
 
Have you tried to set the DefaultView property to 4 ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top