enumerate a collection of text boxes

  • Thread starter Thread starter Kuroda
  • Start date Start date
K

Kuroda

Hello,
I am trying to loop through a series of text boxes named
a0 to a30, and add the values 1 - 30 to each of the text
boxes, but for some reason my code is stopping at the 2nd
line:
For curbox = 0 To 41 'need to loop thru 30 textboxes
Me("D" & curbox) = DatePart("d", curday)
Would anyone help me with this code?
Thanks,
Chieko
 
Dim intNum As Integer
For intNum = 0 To 41
Me.Controls("a" & intNum).Value = DatePart("d", curday)
Next intNum
 
Kuroda said:
I am trying to loop through a series of text boxes named
a0 to a30, and add the values 1 - 30 to each of the text
boxes, but for some reason my code is stopping at the 2nd
line:
For curbox = 0 To 41 'need to loop thru 30 textboxes
Me("D" & curbox) = DatePart("d", curday)


Well, you said the text boxes are named A0 through A30, but
the code is using D0 through D41.
 
Thanks, that helped.
Chieko
-----Original Message-----
Dim intNum As Integer
For intNum = 0 To 41
Me.Controls("a" & intNum).Value = DatePart("d", curday)
Next intNum

--
Ken Snell
<MS ACCESS MVP>





.
 
< wink >

I noticed that too Marsh, but thought maybe it was just my newsreader
"misreading".... < g, d, & r >
 
Back
Top