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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

for i=1 to 100 next i problem

Status
Not open for further replies.

jaanisf

Technical User
Apr 30, 2003
50
LV
If my labels' names are d1, d2, d3, etc.., how should I handle this?

4th row needs to be handled differently, but how?

Private Sub btnshod_Click()
Dim di
For di = 1 To 27
Me!d & (di + 5) &.Caption = Left(Date + di, 2)
Next di
End Sub

 
Private Sub btnshod_Click()
Dim di
For di = 1 To 27
Me("d" & di + 5).Caption = Left(Date + di, 2)
Next di
End Sub

found it by myself, never mind ;)
 
Not quite sure what you mean by fourth row but here goes

Private Sub btnshod_Click()
Dim di
For di = 1 To 27
if di = 4 then
blah blah blah
else
Me!d & (di + 5) &.Caption = Left(Date + di, 2)
end if
Next di
End Sub

If this is not what you want can you explain it more.
 
Heh, Savil, I meant that the 4th row gives an error and has to be handled differently ;)
But I found it, I should use this
Me("d" & di + 5).Caption = Left(Date + di, 2)
instead of
Me!d & (di + 5) &.Caption = Left(Date + di, 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top