Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

labels

Posted on 1998-12-31
8
Medium Priority
?
250 Views
Last Modified: 2010-05-03
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
0
Comment
Question by:groone
  • 4
  • 2
  • 2
8 Comments
 
LVL 1

Expert Comment

by:MAVERICK
ID: 1453516
You could try using a control array .......
ie... Listbox(0) listbox(1) etc...

0
 
LVL 3

Author Comment

by:groone
ID: 1453517
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
 
LVL 1

Expert Comment

by:MAVERICK
ID: 1453518
I've seen it done.. But I'd have to try and make a sample first :)
 
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Expert Comment

by:agrillage
ID: 1453519
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
 
LVL 3

Author Comment

by:groone
ID: 1453520
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
 
LVL 3

Author Comment

by:groone
ID: 1453521
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
 
LVL 3

Author Comment

by:groone
ID: 1453522
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
 
LVL 1

Accepted Solution

by:
agrillage earned 600 total points
ID: 1453523
No problems groone. Thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question