Timeline report weirdness

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?
 
G

Gitche Gumee

I have discovered the solution to this issue, but I don't understand it. I
had actually been modeling code I found on The Access Web by Dev Ashish. It
is like Duane Hookom's code in CalendarReports samples. But Duane Hookom's
code included an additional bit:

Me.txtName.Width = 10 ' avoid the positioning error

When I add this bit to my sub, it works at last.

Can anyone (Duane?) explain what this positioning error is and why I need to
accommodate it? I am very glad to be avoiding this error after many hours of
beating my head against it, but I'd like to understand what it's all about.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top