I have a subform B in form A. Subform B is a continuous form to which I added a button. This same button, of course, appears in every record so I have to figure out which record is the active record after the button is clicked.
When I create the button, I added an event procedure for the click event. The program takes me to Private Sub Command21_Click(), to which I added the code below:
Code:
Private Sub Command21_Click()
MsgBox ("Hello!")
End Sub
I know I'm in the right place, because on the top of the ide window are the words (essentially) Form_B subform(Code)
When I click the button, there is no msgbox. When I put a stop, the code doesn't stop.
I then made a macro for the click event with two items
runcode - Forms!A!B.Form!Command21_Click
Msgbox ("Did it work")
A msgbox pops up with "Did it work"
No msgbox for "Hello"
This same result happens when I step through the code
Then I tried runcode Forms!A!B.Form!Command21_Clickthisshouldn'twork
Same thing happens
Then I tried runcode expletives deleted
Msgbox ("Did it work")
And step through the code. The error comes up, can't find expletives deleted To access procedures in other forms etc. etc.
How can I get code to fire for a click in the subform
Here are some pictures



There's more. When I look at the controls that the IDE acknowledges, Command21, my button isn't even listed

But when I added the Controltiptext, just to see if the properties window on the side is real, the text shows up upon hovering

Can I just say that javascript is infinitely easier. There's no form subform nonsense. The objects aren't nested on into the other, and when there's an error, the browser throws it.