I really have a BIG problem in making control arrays.
The following is what i fed to the PC
sub form_load()
const n=15
dim Sam(n) as textbox
for n=1 to 15
sam(n).text="SamY"
next n
end sub
It won't work.
SamY 6 Junior Poster in Training
Recommended Answers
Jump to PostHi
Yuo can not create a control just like that. You have to set the control to something. That is the error that you are getting.
This will do the trick:
Dim sam(15) As TextBox For i = 1 To 15 Set sam(i) = Controls.Add("vb.TextBox", …
Jump to PostYou could also use load... which works just as well. Start a new project, and add a textbox... leave it's name alone (Text1). In The Properties Box, change index to 0. Now, in your form load (or in a button) add this:
For I = 0 To …
All 7 Replies
Scottg1989 2 Junior Poster
SamY 6 Junior Poster in Training
Scottg1989 2 Junior Poster
williamrojas78 11 Junior Poster
Comatose 290 Taboo Programmer Team Colleague
SamY 6 Junior Poster in Training
SamY 6 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.