I don't know if this is even possible, but I've been searching for a while now with no success. I have a range of integer variables str1, str2, str3, etc. and need to increment their respective value by one (1) when the value of a second string (varNUM) equals the number in the first string.
Here is how I'm setting it up
The last line is where I can't figure out the correct syntax to get VBA to recognize it as a string variable.
What I'm hoping for is if the value of varNUM is 2, then the code will increment nstr2 by 1. Can anyone help me with the proper syntax?
Here is how I'm setting it up
Code:
Dim nstr1 As Integer
Dim nstr2 As Integer
Dim nstr3 As Integer
Dim varNUM As Integer
nstr1 = 0
nstr2 = 0
nstr3 = 0
varNUM = DLookup("[FieldValue]", "TBLSurveySelections", "[StoreValue] = '" & fldReport & "'") 'this will set varNUM to a value of 1-3
nstr(varNUM) = nstr(varNUM) + 1 'this is the part I can't get to work
What I'm hoping for is if the value of varNUM is 2, then the code will increment nstr2 by 1. Can anyone help me with the proper syntax?
Comment