S
sparkes84
Hi, really stuck. Thought I had written the code correctly but when I click
on my command button to run my macro, it comes up with 'Object required'.
When I click on Tools and then Macros, my macro on there is called
Sheet1.RemoveThem
My code looks like this - where have I gone wrong?
Private Sub CommandButton1_Click()
On Error GoTo Err_Command1_Click
Dim stMacroName As String
stMacroName = "Sheet1.RemoveThem"
DoCmd.RunMacro stMacroName
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
Thanks for any help
on my command button to run my macro, it comes up with 'Object required'.
When I click on Tools and then Macros, my macro on there is called
Sheet1.RemoveThem
My code looks like this - where have I gone wrong?
Private Sub CommandButton1_Click()
On Error GoTo Err_Command1_Click
Dim stMacroName As String
stMacroName = "Sheet1.RemoveThem"
DoCmd.RunMacro stMacroName
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
Thanks for any help