Can an Event and Event content be assigned programmatically?

  • Thread starter Thread starter Kan D.
  • Start date Start date
K

Kan D.

Can an event AND event content be assigned prorammatically to a control?

See below example's ".OnClick" line...

Dim c_imgStatus As Image

With c_imgStatus
.Name = "imgStatus" & i
.Picture = "\\path\path\Status Button.jpg"
.HyperlinkSubAddress = "Form FormName"
.OnClick = "MyVariable = " my_OtherVariable & Chr(13) & _
"msgBox MyVariable"
End With

So when I click on the button, I want the click to execute the button's "On
Click" event that I'm trying to programmtically assign...

Thank you for your help,

Kan
 
Back
Top