Hi,
I'm trying to export a report to PDF. I get the MS Access error...
"A custom macro in this report has failed to run, and is preventing the report from rendering"
The reports then opens in Access. I try to manually send to PDF and Snapshot view and neither works, I still get the same error message.
This was working fine the week before and I haven't made any changes to it.
Code...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim vStartBar As Integer
Dim vHeight As Integer
Dim vLeft As Integer
Dim vTop As Integer
Dim vWidth As Integer
Dim vStart As Date
vTop = 50
vStart = CDate(Month(Date) & "/1/ " & Year(Date))
If Me.StartDate.Value > vStart Then
vStartBar = DateDiff("D", vStart, Me.StartDate) + 1
vLeft = ((vStartBar * 0.0162) + 4.7083) * 1440
vWidth = (Me.txtDays * 0.0162) * 1440
If (vLeft + vWidth) > 11088 Then
vWidth = 11088 - vLeft
End If
Me.txtBar.Width = vWidth <<< This one works fine >>>
Me.txtBar.Left = vLeft
Me.txtBar.Height = 200
Me.txtBar.Top = vTop
Me.txtBar.BackColor = GetBarColor(Me.txtType, Me.txtMOS)
Else
vStartBar = DateDiff("D", vStart, Me.EndDate) + 1
vLeft = 4.7083 * 1440
vWidth = ((vStartBar * 0.0162) * 1440)
Me.txtBar.Width = vWidth <<< Errors out here >>>
Me.txtBar.Left = vLeft
Me.txtBar.Height = 200
Me.txtBar.Top = vTop
Me.txtBar.BackColor = GetBarColor(Me.txtType, Me.txtMOS)
End If
End Sub
I'm trying to export a report to PDF. I get the MS Access error...
"A custom macro in this report has failed to run, and is preventing the report from rendering"
The reports then opens in Access. I try to manually send to PDF and Snapshot view and neither works, I still get the same error message.
This was working fine the week before and I haven't made any changes to it.
Code...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim vStartBar As Integer
Dim vHeight As Integer
Dim vLeft As Integer
Dim vTop As Integer
Dim vWidth As Integer
Dim vStart As Date
vTop = 50
vStart = CDate(Month(Date) & "/1/ " & Year(Date))
If Me.StartDate.Value > vStart Then
vStartBar = DateDiff("D", vStart, Me.StartDate) + 1
vLeft = ((vStartBar * 0.0162) + 4.7083) * 1440
vWidth = (Me.txtDays * 0.0162) * 1440
If (vLeft + vWidth) > 11088 Then
vWidth = 11088 - vLeft
End If
Me.txtBar.Width = vWidth <<< This one works fine >>>
Me.txtBar.Left = vLeft
Me.txtBar.Height = 200
Me.txtBar.Top = vTop
Me.txtBar.BackColor = GetBarColor(Me.txtType, Me.txtMOS)
Else
vStartBar = DateDiff("D", vStart, Me.EndDate) + 1
vLeft = 4.7083 * 1440
vWidth = ((vStartBar * 0.0162) * 1440)
Me.txtBar.Width = vWidth <<< Errors out here >>>
Me.txtBar.Left = vLeft
Me.txtBar.Height = 200
Me.txtBar.Top = vTop
Me.txtBar.BackColor = GetBarColor(Me.txtType, Me.txtMOS)
End If
End Sub