Re: How can I run over controls dynamically ?
- From: "Scott M." <quanker@xxxxxxxxx>
- Date: 12 Jul 2006 08:04:37 -0700
Instead of six separate controls, create an array of text boxes. To do
this, create the first one with the proper name and features like size,
font, etc. and then copy and paste it back on to the form. When the
message pops up asking you if you want to create a control array, say
Yes. Now paste 4 more times. You will end up with txtFax(1), txtFax(2),
etc. Now looping through them will be a breeze.
Scott
DavidE wrote:
Hi,
I put on a form 6 textboxes and I try to check their text property value in
a loop . I want to do it dynamically without using Case statements.
The name of the textBoxes are :
txtFax1,txtFax2,txtFax3,txtFax4,txtFax5,txtFax6.
I use this code :
For i= 1 to 6
If Not ("txtFax" & i).Text = "" Then ' It's doesnt work like this b
.....
End If
Next
I have an error in this line: If Not ("txtFax" & i).Text = "" Then
because "txtFax" & i is a string, not a text box
How can I do it dynamically ?
Thanks,
David
.
- Follow-Ups:
- Re: How can I run over controls dynamically ?
- From: Scott M.
- Re: How can I run over controls dynamically ?
- Prev by Date: Re: Mike: Restating your explanation
- Next by Date: HELP! I just screwed up my Project!
- Previous by thread: Active X problem
- Next by thread: Re: How can I run over controls dynamically ?
- Index(es):
Relevant Pages
|