M
Magnolia
Hello,
I would like to dynamically initialize controls in my form. I have a
group of controls that have a name that starts by txtquantity. So I
have:
txtquantity1
txtquantity2
txtquantity3
etc
To set the value of those fields, the easy solution would be to do:
txtquantity1.value = toto1
txtquantity2.value = toto2
txtquantity3.value = toto3
etc
But I would prefer to use a while to dynamically create the command
line and to use something like this:
While intLevel <= intnbNiveau
txtQuantity & intLevel = "toto" & cstr(intLevel)
intLevel = intLevel + 1
Wend
But that code does not work. What would you recommend??? I have looked
on the newsgroup and I can't find something that works.
Thanks a lot in advance !!!
Nancy
---------------------------------------------
By the way, I have also tried the Eval function. In order to keep it
simple to start, I did the following test:
Step1 :
Forms!frmAddProductToPriceList!txtQuantity1 = 88
This works. It has set my field to the value 88.
Step 2: I have replaced my line by:
Eval ("Forms!frmAddProductToPriceList!txtQuantite1 = cstr(88)")
The field stayed empty !?!!??!?!?!
I would like to dynamically initialize controls in my form. I have a
group of controls that have a name that starts by txtquantity. So I
have:
txtquantity1
txtquantity2
txtquantity3
etc
To set the value of those fields, the easy solution would be to do:
txtquantity1.value = toto1
txtquantity2.value = toto2
txtquantity3.value = toto3
etc
But I would prefer to use a while to dynamically create the command
line and to use something like this:
While intLevel <= intnbNiveau
txtQuantity & intLevel = "toto" & cstr(intLevel)
intLevel = intLevel + 1
Wend
But that code does not work. What would you recommend??? I have looked
on the newsgroup and I can't find something that works.
Thanks a lot in advance !!!
Nancy
---------------------------------------------
By the way, I have also tried the Eval function. In order to keep it
simple to start, I did the following test:
Step1 :
Forms!frmAddProductToPriceList!txtQuantity1 = 88
This works. It has set my field to the value 88.
Step 2: I have replaced my line by:
Eval ("Forms!frmAddProductToPriceList!txtQuantite1 = cstr(88)")
The field stayed empty !?!!??!?!?!