Open Design View thru Button Command

Trigger99

Registered User.
Local time
Today, 18:40
Joined
Mar 23, 2007
Messages
17
IS there a way to open a query in design view thru a button command on a form? thx
 
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
 
Sorry:

DoCmd.OpenQuery "YourQueryNameHere", acViewDesign
 

Users who are viewing this thread

Back
Top Bottom