title: VBA CommandBarButton does not run code OnAction
body: <p>Once the button is pressed it does not perform the subroutine defined <strong>OnAction</strong> method.</p>
  
  <p>I have checked all the Security options in Access are enabled and have written the same code in different ways.</p>
  
  <p>I have tried to run a function with the <strong>OnAction</strong> method instead.</p>
  
  <pre class="lang-vb prettyprint-override"><code>Private Sub Check_Status_Click()
      Dim cmdBAR As CommandBar
      Dim cmdButton1 As CommandBarButton
  
      Set cmdBAR = CommandBars.Add(, msoBarPopup, False, True)
      Set cmdButton1 = cmdBAR.Controls.Add(msoControlButton)
  
      cmdButton1.Caption = "Dale"
      cmdButton1.OnAction = "Dale"
      cmdBAR.ShowPopup
  
      'Clean
      Set cmdBAR = Nothing
      Set cmdButton1 = Nothing
  End Sub
  
  Public Sub Dale()
      MsgBox "hola"
  End Sub
  </code></pre>
  
  <p>I dont get any error, just it is not doing anything even the menu shows up.</p>