query running a sheet in datasheet view despite property setting

E

Eamonn

Hi,

I have a query that is running a "select * from sheet X" command where I
want it to display a graph . Now the query works fine but when I run it off a
command button on my main form it fails to display my data as a pivot chart
even though It does it by default when I run the query from my database
window. I have set the default view of the query to pivot chart but this is
ignored when run through my form. Any ideas ?

Cheers
 
J

Jerry Whittle

If you created the button using the Wizard, the code should look something
like so:

Dim stDocName As String

stDocName = "qry3Years"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Change acNormal to acViewPivotChart .
 
Top