using & to refer to different objects

  • Thread starter Thread starter evanosky
  • Start date Start date
E

evanosky

Guest
If I label 30 objects date1, date2, etc.

Is there a way to refere to each date within a loop rather than say

date1 =
date2 =

maybe perhaps date* =

I have tried some things, but the biggest problem which presents itself is when I try using variables. I get type mismatch or it can't find what I am referring to. Any help would be appreciated.
 
To add to Pat's advise, you can use:

Dim ctrl As Control

For Each ctrl In Me.Controls
If ctrl.ControlType = acTextBox Then
If Right(ctrl.Name, 1) = "2" Then
ctrl.SetFocus
ctrl.Value = "2"
Else
ctrl.SetFocus
ctrl.value = "1"
End If

End If
Next ctrl

(the controltype and name properties will not appear in the list of properties when you type ctrl., but it is a valid property of a control.)

[This message has been edited by DML (edited 06-29-2000).]
 

Users who are viewing this thread

Back
Top Bottom