form controls?

willem
07-19-2001, 11:52 AM
I have this form on which i created some fields, i need to change the source of 31 textboxes, they are named text1, text2, ...
Is there a way to refer to these textboxes in the following way.
Can you give me some comments on this?

strsource = 1/1/2001
for i = 1 TO 31
counter=i
strname= "text" & counter
form.strname.recordsource= strsource
form.strname.value= "text"
strscource=strsource+1
next i
Thanks for your help

KesleyK
07-19-2001, 02:23 PM
To do this, make your textboxes part of a control array, then you could refer to them as myTextBox(i) where i is your integer index.

______
Cheers!

willem
07-20-2001, 10:35 AM
I used the technique you proposed.
But there is still a problem.
I change the value of a textbox in the on load event but i can't change the controlsource.
Thanks for your replies

Willem

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum