thx but that only open my form. I need the button command to open a query. I am new to Access and VB. Here is my code. What do I need to change to have it design view the query?
Private Sub Command7_Click()
On Error GoTo Err_Command7_Click
Dim stDocName As String
stDocName = "Sales by Week"
DoCmd.RunCommand stDocName, acCmdDesignView
Exit_Command7_Click:
Exit Sub
Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click
End Sub