I've used Duane Hookom's code in the past, and found no problems with it.
I've just had a look at the Calendar crew rotation sample, which seems to be
where the code you're using comes from. A quick play with the data in the
sample database got me an overflow error - I changed the year of the End
Date of one of the data records, and boom!!! So it's likely that your wide
range of dates is indeed the problem. The sample code is setting dblFactor
(used to scale the txtName box) for 365 days (1 year), and the sample data
all fits within that range. I suspect that if your wanting to cover
approximately 7 years, you'll need to change the 365 in the line
dblFactor = Me.boxTimeLine.Width / 365
to a suitably larger value (the number of days between your start date and
end date).
If you're using a set of textboxes in the header, showing months (as in the
sample - it's what the comment line in the code refers to), you'll probably
want/need to change these to show years for the project.
You may also want to include code somewhere that checks for data which will
cause problems (eg. EndDate earlier than StartDate; or missing StartDate or
EndDate, or ...). You could do this in either your data entry form(s), or
by using error trapping on the timeline report. Such features are not
normally included in sample databases, but are essential in real-life
applications.
HTH,
Rob
<
jmru...@gmail.com> wrote in message
news:2235d9c0-b593-4892...@googlegroups.com...