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

Button error during creation

Status
Not open for further replies.

cdl1701

Technical User
Dec 10, 2004
47
0
0
US
I am trying to set up a button to run a macro that opens a report... but when I get to the end of the wizard and pick finish I get this "Method 'Module' of object '_Form_JW-CONSTRUCTION' failed". It will not let me create the button. The macro, report and Query run fine. What am I doing wrong?

Thanks,
Chris
 
Hello Chris,
What does the code on your button look like? It should look similar to this:
===========================================
Private Sub YourButtonName_Click()
On Error GoTo Err_YourButtonName_Click

Dim stDocName As String

stDocName = "Macro1"
DoCmd.RunMacro stDocName

Exit_YourButtonName_Click:
Exit Sub

Err_YourButtonName_Click:
MsgBox Err.Description
Resume Exit_YourButtonName_Click

End Sub
===========================================

Hope this helps - Gnism.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top