JGalletta
Windows 7 Access 2010
- Local time
- Yesterday, 22:02
- Joined
- Feb 9, 2012
- Messages
- 149
I've declared the following:
I have a loop that takes the number part of a control name using:
(Controls are named with a single letter followed by sequential numbers.)
How can I refer to the corresponding variable from within this loop?
For example when the control loops through control G10, I'd like to refer to C10.
I'm having trouble building the variable reference:
I know this would be possible by creating another variable to refer to a string created by concatenating C and the Number like this:
I would like to skip this silliness completely and do it the right way - how is this accomplished? I trust you can understand what I'm trying to get at.. I just don't exactly know how to describe it clearly.
Code:
Dim C(12) As String
I have a loop that takes the number part of a control name using:
Code:
Right(controlname, Len(controlname) - 1)
How can I refer to the corresponding variable from within this loop?
For example when the control loops through control G10, I'd like to refer to C10.
I'm having trouble building the variable reference:
I know this would be possible by creating another variable to refer to a string created by concatenating C and the Number like this:
Code:
Dim CandNumber As String
CandNumber = "C" & Right(controlname, Len(controlname) - 1)
'This will build the control name, but how can I reference its contents?
I would like to skip this silliness completely and do it the right way - how is this accomplished? I trust you can understand what I'm trying to get at.. I just don't exactly know how to describe it clearly.