labels

I have a database and I can gather all the fields in to variables.  There may never be the same amount of fields in the database so the number of my variables will change.  Now for the good part.  I need a label and corresponding text box per variable.  As stated the number of variables will not be constant so the number of labels and text boxes can not be constant.  thanks
LVL 3
grooneAsked:
Who is Participating?
 
agrillageConnect With a Mentor Commented:
No problems groone. Thanks.
0
 
MAVERICKCommented:
You could try using a control array .......
ie... Listbox(0) listbox(1) etc...

0
 
grooneAuthor Commented:
Hmm, I guess what i need is to be able to create labels on the fly because if I use a control array i still have to populate my form with a determined amount of controls.  From what i have read, it is not possible to create controls on the fly ;x
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
MAVERICKCommented:
I've seen it done.. But I'd have to try and make a sample first :)
 
0
 
agrillageCommented:
Controls can be created on the fly using the Load Statement. For example

Load TextBox1(1)

When TextBox1(0) already exists. If you also put your field variables into a dynamic array (check out the ReDim keyword) you can find out how many you have using the UBound function.
0
 
grooneAuthor Commented:
Good lord, for the points i would expect to see a little snippet of code as an example or more of a definition on how to use the objects you described.
0
 
grooneAuthor Commented:
Sorry agrillage

I started playing with the UBound function and the load statement and there really was not much to it.  For some reason i thought it was going to be complicated.  Your answer was perfectly acceptable.  Please reanswer this question for the points.  That will teach me to look at this place when i just wake up ;x
0
 
grooneAuthor Commented:
Sorry agrillage

I started playing with the UBound function and the load statement and there really was not much to it.  For some reason i thought it was going to be complicated.  Your answer was perfectly acceptable.  Please reanswer this question for the points.  That will teach me to look at this place when i just wake up ;x
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.