Im trying to reference an existing control by name. The reason Im doing this at runtime is because I am trying to add javascript blur() event to alot of textboxes. When the blur() event executes a javascript function will do some calculations. I have a lot of textboxes and I want to streamline my code. Below is what Im trying to do with the textboxes.
I have textboxes with the ids jan3, feb3, mar3...jan13,feb13, mar13
For s = 3 To 13
MonthAttr(jan & s)
MonthAttr(feb & s)
MonthAttr(mar & s)
MonthAttr(apr & s)
.
.
.
Next s
Private Sub MonthAttr(ByVal mon As Object)
mon.Attributes.Add("onblur", "calculate()")
End Sub
Thanks,
James