R
Ryan Addams
Hi
I have utilised Duane Hookom's gantt chart report from
http://www.access.hookom.net/Samples/CalendarReports.zip
Then I decided rather than to view it as a year, to view it as a
month, and I was wondering if there was a way to get access to show a
grid for dates on it? the current code is:
Option Compare Database
Option Explicit
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'days of tour
Dim lngStart As Long 'start date of tour
Dim lngLMarg As Long
Dim dblFactor As Double
Dim X As Double
'put a line control in your page header that starts 1/1 and goes
to 12/31
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 31
lngStart = DateDiff("d", Me.Monthname, Me.[Start Date])
lngDuration = DateDiff("d", Me.[Start Date], Me.[End Date])
'set the color of the bar based on a data value
Me.txtName.BackColor = Me.TaskColour
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = False
End Sub
Private Sub Report_Close()
DoCmd.Restore
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
Any help would be appreciated.
I have utilised Duane Hookom's gantt chart report from
http://www.access.hookom.net/Samples/CalendarReports.zip
Then I decided rather than to view it as a year, to view it as a
month, and I was wondering if there was a way to get access to show a
grid for dates on it? the current code is:
Option Compare Database
Option Explicit
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim lngDuration As Long 'days of tour
Dim lngStart As Long 'start date of tour
Dim lngLMarg As Long
Dim dblFactor As Double
Dim X As Double
'put a line control in your page header that starts 1/1 and goes
to 12/31
lngLMarg = Me.boxTimeLine.Left
dblFactor = Me.boxTimeLine.Width / 31
lngStart = DateDiff("d", Me.Monthname, Me.[Start Date])
lngDuration = DateDiff("d", Me.[Start Date], Me.[End Date])
'set the color of the bar based on a data value
Me.txtName.BackColor = Me.TaskColour
Me.txtName.Width = 10 'avoid the positioning error
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
Me.MoveLayout = False
End Sub
Private Sub Report_Close()
DoCmd.Restore
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
Any help would be appreciated.