Hi,
I'm creating a one-off timeline that is comprised of some lines, and labels.
This is being created in a report within a group header/
Problem is, there are a lot of them, I'm creating a weekly calendar and I need ONE line and ONE label per week. Two years worth is over 100 of each of these.
What I'm doing now is creating ALL of these lines and labels with names sticking those names in an array, and looping through some dates to position them. (Works pretty well) but it's a bit much.
Create ALL the lines and create an array. (it's big)
lineObjects = array("lnA", "lnB".......
Same with the labels.
Then I loop through dates, and position the lines and labels.
Code:
curDate = fromDate
c = 0
Do While curDate <= toDate
yPitch = DateDiff("d", fromDate, curDate)
Me.Controls(lineObjects(c)).Left = (dayPitch * yPitch)
Me.Controls(labelObjects(c)).Left = (dayPitch * yPitch) + 10
Me.Controls(labelObjects(c)).Caption = Format(DatePart("ww", curDate, vbMonday, vbFirstFourDays), "00")
curDate = curDate + 7
c = c + 1
Loop
Is there an easier way?