I know this must be one of those situations where there is an obvious answer but so far I have failed to see it.
Ok heres the idea. Adding elements to a form programmatically, like a checkbox , based on reading some external data source. One check box for each entry.
How do you add a dynamically generated name to a dim statement?
Dim checkbox & I As New CheckBox
Where I is an incremented integer doesnt work.
Dim name as string
Name= chk & I.tostring
Dim Name as new checkbox is also a never going to work
But there must be a better way than
I is incremented integer
Select I
Case 1 Dim checkbox1 & I As New CheckBox
Case 2 Dim checkbox2 & I As New CheckBox
Case 3 Dim checkbox3 & I As New CheckBox
Etc especial when u dont know how many to allow for
Oh I know we have list box and other tools available but still would love to know how to get a variable string in to a Dim statement as a name ? Any thoughts??
Ok heres the idea. Adding elements to a form programmatically, like a checkbox , based on reading some external data source. One check box for each entry.
How do you add a dynamically generated name to a dim statement?
Dim checkbox & I As New CheckBox
Where I is an incremented integer doesnt work.
Dim name as string
Name= chk & I.tostring
Dim Name as new checkbox is also a never going to work
But there must be a better way than
I is incremented integer
Select I
Case 1 Dim checkbox1 & I As New CheckBox
Case 2 Dim checkbox2 & I As New CheckBox
Case 3 Dim checkbox3 & I As New CheckBox
Etc especial when u dont know how many to allow for
Oh I know we have list box and other tools available but still would love to know how to get a variable string in to a Dim statement as a name ? Any thoughts??