I have been working oin this report for a while. It works now butI need the following codes to make the box grow to match the start date and end date. right now, it grows according the number of days. Instead, I want the trip total days to show in the timeline showing startdate and end date in each timeline.
Any help will be great.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intStartDayDiff As Integer
Dim intDayDiff As Integer
Dim sngFactor As Single
On Error Resume Next
Me.ScaleMode = 1 'Twips
sngFactor = Me.boxMaxDays.Width / mintDayDiff
If Not IsNull(Me.ProjectSubDate) And Not IsNull(Me.ProjectSubEnddate) Then
Me.boxGrowForDate.Visible = True
Me.lblTotalDays.Visible = True
intStartDayDiff = Abs(DateDiff("d", Me.ProjectSubDate, mdatEarliest))
intDayDiff = Abs(DateDiff("d", Me.ProjectSubEnddate, Me.ProjectSubDate))
If intStartDayDiff = 0 Then intStartDayDiff = 1
With Me.boxGrowForDate
.Left = Me.boxMaxDays.Left + (intStartDayDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With
Me.lblTotalDays.Left = Me.boxGrowForDate.Left
Me.lblTotalDays.Caption = intDayDiff & " Day(s)"
Else '
Me.boxGrowForDate.Visible = False
Me.lblTotalDays.Visible = False
End If
End Sub
Any help will be great.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intStartDayDiff As Integer
Dim intDayDiff As Integer
Dim sngFactor As Single
On Error Resume Next
Me.ScaleMode = 1 'Twips
sngFactor = Me.boxMaxDays.Width / mintDayDiff
If Not IsNull(Me.ProjectSubDate) And Not IsNull(Me.ProjectSubEnddate) Then
Me.boxGrowForDate.Visible = True
Me.lblTotalDays.Visible = True
intStartDayDiff = Abs(DateDiff("d", Me.ProjectSubDate, mdatEarliest))
intDayDiff = Abs(DateDiff("d", Me.ProjectSubEnddate, Me.ProjectSubDate))
If intStartDayDiff = 0 Then intStartDayDiff = 1
With Me.boxGrowForDate
.Left = Me.boxMaxDays.Left + (intStartDayDiff * sngFactor)
.Width = intDayDiff * sngFactor
End With
Me.lblTotalDays.Left = Me.boxGrowForDate.Left
Me.lblTotalDays.Caption = intDayDiff & " Day(s)"
Else '
Me.boxGrowForDate.Visible = False
Me.lblTotalDays.Visible = False
End If
End Sub