G
Gitche Gumee
I have created a timeline (gantt) report using Duane Hookom's technique. It
works great except for one item (project) whose timeline refuses to accept
the calculated setting for .left. Instead it takes the previous project's
setting.
I have tried various start dates, I have tried deleting and reentering the
project. I have tried hard-coding the .left setting. Hard-coding "works"
until the start date is later than the start date of the previous project. If
I re-sort the projects so that the problem project appears in a different
sequence, it works correctly. When project B immediately follows project A in
the sort order, they do not play nice together.
Here's the code where I set the starting point for the timeline based on the
start date of the project:
sngFactor = Me.boxMaxDays.Width / mintDayDiff
intStartDayDiff = Abs(DateDiff("d", Me.[StartDate], [ReportStartDate]))
intDayDiff = Abs(DateDiff("d", Me.[EndDate], Me.[StartDate]))
With Me.boxGrowForDate
.Left = Me.boxMaxDays.Left + (intStartDayDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With
When I display the result of the calculation, it is correct. But when I
immediately display the setting for .left, it's wrong.
What can possibly cause this sort of behavior?
works great except for one item (project) whose timeline refuses to accept
the calculated setting for .left. Instead it takes the previous project's
setting.
I have tried various start dates, I have tried deleting and reentering the
project. I have tried hard-coding the .left setting. Hard-coding "works"
until the start date is later than the start date of the previous project. If
I re-sort the projects so that the problem project appears in a different
sequence, it works correctly. When project B immediately follows project A in
the sort order, they do not play nice together.
Here's the code where I set the starting point for the timeline based on the
start date of the project:
sngFactor = Me.boxMaxDays.Width / mintDayDiff
intStartDayDiff = Abs(DateDiff("d", Me.[StartDate], [ReportStartDate]))
intDayDiff = Abs(DateDiff("d", Me.[EndDate], Me.[StartDate]))
With Me.boxGrowForDate
.Left = Me.boxMaxDays.Left + (intStartDayDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With
When I display the result of the calculation, it is correct. But when I
immediately display the setting for .left, it's wrong.
What can possibly cause this sort of behavior?