Hello all,
I have 52 unbound text boxes on a form.
I'm trying to create a For loop that will assign each textbox a value, here's my code:
Code:
Private Sub Form_Load()
Dim O(6, 52) As Integer
Dim i As Integer
For i = 0 To 51
O(1, i + 1) = DCount("Field1", "Table1", "DateValue([Field1]) Between DateSerial(Year(Date())-1,1,1) And DateSerial(Year(Date())-1,1,8)")
Me.Text(i + 1).Value = O(1, i + 1)
Next i
End Sub
After I get this figured out, I'll be trying to figure out how I can increment the DateSerial by the 52 weeks of the year.
So basically each textbox(1-52) will have a count for each week of the year.
Hopefully this makes since, but that is for a future post, right now I'm just trying to figure out if I can increment a textbox to give it a value.
Thank you!