I’m trying to do something that would be really simple in any other language but after about an hour of searching online I can’t find how to do it in Vba. Basically I have a checkbox which when clicked should assign its Name to a variable and display the name in a message box. My actual function is much larger but this is the only bit that I need assistance on.
Private Sub admin_toggle_Click()
Dim admin_group As String
Dim admin_name As String
Dim admin_value As String
admin_name = ActiveControl.Name
MsgBox admin_name
End Sub
The solution is as follows:
Because the checkbox I was referring to was contained within a frame, I had to reference the encasing frame before accessing the element I needed.