I have a macro in Access 2016 using a for loop to check the values of check boxes. I want to submit the values to a table. I don't want the standard checkbox value for true (-1) I want the value of a 'rolling' count of which has been checked.
e.g. CB1 CB2 CB3 CB4
If only CB1 and CB4 are checked then I want to submit to the table the values 1 for CB1 and 2 for CB4.
My for loop is:
For i = 1 To 8
If Me.Controls("CP" & i) = -1 Then
"CP" & i = I 'ISSUE IS HERE
Debug.Print Me.Controls("CP" & i)
End If
Next i
How do I refer to the variable value? so CP & I = CP1, CP2, CP3, CP4 etc...
Me.Controls("CP" & i)= I?