Hello Everyone,
It is my very first time posting in a Forum. I am a beginner to Access and VBA. I have a question and it is a bit difficult for me to explain it clearly in English. I hope you can understand what I am looking for.
I want to paste the code below and explain what result I want.
Public Function test()
Dim a, b, c, counter As Long
a = 9
b = 3
c = a / b
counter = 1
For i = 1 To b
For j = 1 To c
Debug.Print "Group#(" & counter & ") " & j
Next
Debug.Print "-----------"
counter = counter + 1
Next
End Function
Result:
debug.print test
Group#(1) 1
Group#(1) 2
Group#(1) 3
-----------
Group#(2) 1
Group#(2) 2
Group#(2) 3
-----------
Group#(3) 1
Group#(3) 2
Group#(3) 3
-----------
There are three groups. Group#1 started from 1 to 3, now for group#2 it want to display from 4 to 6 and for group#3 from 7 to 9.
I hope it makes sense. Thank you so much for your help.