5 pts.
 Access 2003 – command button to show query in pivot format
I have a form with a comman button.  I want the user to be brought to a query when they press the button.  The query is built in a pivot table format, but when accessed by the command button, it appears as a datatable instead.  What am I doing wrong?

Software/Hardware used:
Office 2003
ASKED: September 27, 2010  2:54 PM
UPDATED: September 28, 2010  7:35 PM

Answer Wiki:
Here is an example using a command button on an Access2003 form PART CODE BASEPRICE ABRA OLD $250.00 CA MID $2.50 CA NEW $2.00 DA MID $200.00 BRA NEW $250.00 TRANSFORM Sum(tbl3Cols.BasePrice) AS SumOfBasePrice SELECT tbl3Cols.Code, Sum(tbl3Cols.BasePrice) AS [Total Of BasePrice] FROM tbl3Cols GROUP BY tbl3Cols.Code PIVOT tbl3Cols.Part; RETURNS CODE Total Of BasePrice ABRA BRA CA DA MID 202.5 2.5 200 NEW 252 250 2 OLD 250 250 Private Sub Command0_Click() On Error GoTo Err_Command0_Click Dim stDocName As String stDocName = "tbl3Cols_Crosstab" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Command0_Click: Exit Sub Err_Command0_Click: MsgBox Err.Description Resume Exit_Command0_Click End Sub
Last Wiki Answer Submitted:  September 28, 2010  7:35 pm  by  mgj   320 pts.
All Answer Wiki Contributors:  mgj   320 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _