M
Mark
I copied some code and tried to customize it for a chart that I want in a
report.
The chart should have the months on top (column headings) and bars that will
span the Created date to the Due date. There should be a bar for each
record. The 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
'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 / 365
lngStart = DateDiff("d", #1/1/2001#, Me.[Created])
lngDuration = DateDiff("d", Me.[Created], Me.[Due Date])
'set the color of the bar based on a data value
Me.txtName.BackColor = Me.[Solicit Name]
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
Since this is existing code that I copied and trying to customize, I do not
know the function of:
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
It seems to crap out here.
Any help debugging this would be greatly appreciated. I cannot seem to find
the source code that I copied this from.
Thanks....
report.
The chart should have the months on top (column headings) and bars that will
span the Created date to the Due date. There should be a bar for each
record. The 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
'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 / 365
lngStart = DateDiff("d", #1/1/2001#, Me.[Created])
lngDuration = DateDiff("d", Me.[Created], Me.[Due Date])
'set the color of the bar based on a data value
Me.txtName.BackColor = Me.[Solicit Name]
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
Since this is existing code that I copied and trying to customize, I do not
know the function of:
Me.txtName.Left = (lngStart * dblFactor) + lngLMarg
Me.txtName.Width = (lngDuration * dblFactor)
It seems to crap out here.
Any help debugging this would be greatly appreciated. I cannot seem to find
the source code that I copied this from.
Thanks....