Gantt Timeline

  • Thread starter Thread starter margaret
  • Start date Start date
M

margaret

I'm using the report rptAppointWeekly from the CalendarReport database that
is recommended when attempting Gantt Timeline. My code on the on format is
as follows:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngTopMargin As Long
Dim lngOneMinute As Long 'size of one minute in twips
Dim datSchedStart As Date
datSchedStart = #8:00:00 AM#
lngOneMinute = 12 'number of twips in one minute
lngTopMargin = 720 'timeline starts 1/2" down in section
'create detail sections as 'layers'
Me.MoveLayout = False
Me.empName.Top = lngTopMargin + DateDiff("n", datSchedStart, Me.start) *
lngOneMinute
Me.empName.Height = DateDiff("n", Me.start, Me.end) * lngOneMinute
Me.empName.Left = (DateDiff("d", Me.WeekOf, Me.boothdate) - 1) * 1500
End Sub

I'm needing it for seven days, thus the -1)*1500 on the me.empname.left.
However, if I have a Sunday date (say 9/13/2009), I get a run time 2100.

Help, please.

Thanks.
 
i expect you are attempting to position the control at a negative location to
the left. WeekOf will return a Sunday as might BoothDate. If they are both
Sunday, your expression will attempt to set the Left property to -1500. I
would remove the -1.
 
Back
Top