Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping through unbound variables 1

Status
Not open for further replies.

tadzo

IS-IT--Management
Sep 16, 2009
1
US
Using Access 2007, VBA within a Form –
Is there a way to transform code such as:
Me.text1=x(1)
Me.text2=x(2)
Me.text3=X(3)

To something like:
For I = 1 to 3
Me.text(I)=X(I)
Next I

Thanks!
 
dim i as integer
for i = 1 to 3
me.controls("text"&i) = x(i)
next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top