There is no way to shorten the book in these lines of code ?
Code:C1 = [Forms]![TStu2SBehTeam]![C1] C2 = [Forms]![TStu2SBehTeam]![C2] C3 = [Forms]![TStu2SBehTeam]![C3] C4 = [Forms]![TStu2SBehTeam]![C4] C5 = [Forms]![TStu2SBehTeam]![C5]
There is no way to shorten the book in these lines of code ?
Code:C1 = [Forms]![TStu2SBehTeam]![C1] C2 = [Forms]![TStu2SBehTeam]![C2] C3 = [Forms]![TStu2SBehTeam]![C3] C4 = [Forms]![TStu2SBehTeam]![C4] C5 = [Forms]![TStu2SBehTeam]![C5]
Thanks Steve
Is it becomes something like this?
Dim i As Integer
For i = C1 To C5
Me("TStu2SBehTeam" & i).Value
Next i
What is the "C1" in red? Is it a control on a form? Or a variable in code?C1 = [Forms]![TStu2SBehTeam]![C1]
For i = 1 to 5
However, the code in the loop is only half an expression. What do you want to do with the value?
And as ssanfu asked, what are C1, etc?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Code:for i = 1 to 27 Me("TStu2SBehTeam" & i).Value = true 'or some value next