No Error on Compile

I am using the following code to compile my vba code by clicking on a button.

Private Sub cmdCompile_Click()

    DoCmd.RunCommand acCmdCompileAllModules
    DoCmd.RunCommand acCmdCompileAndSaveAllModules

End Sub

The code is running, but it is not throwing debug errors when I have problems with my code.  Is there an alternative way I should be writing this?  

I get an error with my code when I use the menu drop down - Debug/Compile, but not when I click the button I created.
Who is Participating?
jefftwilleyConnect With a Mentor Commented:
when u debug/compile manually, what line of code does it fail on?

jamesdean666Author Commented:
the code never failed.. it just never indicated there were errors which I purposely placed in the code to test.

All Courses

From novice to tech pro — start learning today.