I am hoping that someone can take a look at the following code and let me know where I am going wrong - When I run this code I get a
Dim intX As Integer
Dim lngRowTotal As Long
If Me.PrintCount = 1 Then
lngRowTotal = 0
For intX = 2 To intColumnCount
' Starting at column 2 (first text box with crosstab value),
' compute total for current row in detail section.
lngRowTotal = lngRowTotal + Me("Col" + Format(intX))
' Add crosstab value to total for current column.
lngRgColumnTotal(intX) = lngRgColumnTotal(intX) + _
Me("Col" + Format$(intX))
Next intX
' Place row total in text box in detail section.
Me("Col" + Format$(intColumnCount + 1)) = lngRowTotal
' Add row total for current row to grand total.
lngReportTotal = lngReportTotal + lngRowTotal
End If
End Sub
When I run this code I get a type mismatch error on this line:
lngRowTotal = lngRowTotal + Me("Col" + Format(intX))
Any help would be greatly appreciated!!!
Thanks
Dim intX As Integer
Dim lngRowTotal As Long
If Me.PrintCount = 1 Then
lngRowTotal = 0
For intX = 2 To intColumnCount
' Starting at column 2 (first text box with crosstab value),
' compute total for current row in detail section.
lngRowTotal = lngRowTotal + Me("Col" + Format(intX))
' Add crosstab value to total for current column.
lngRgColumnTotal(intX) = lngRgColumnTotal(intX) + _
Me("Col" + Format$(intX))
Next intX
' Place row total in text box in detail section.
Me("Col" + Format$(intColumnCount + 1)) = lngRowTotal
' Add row total for current row to grand total.
lngReportTotal = lngReportTotal + lngRowTotal
End If
End Sub
When I run this code I get a type mismatch error on this line:
lngRowTotal = lngRowTotal + Me("Col" + Format(intX))
Any help would be greatly appreciated!!!
Thanks