A
AaronWestcott via AccessMonster.com
I hope someone can anwer this question as it is bugging me and I can't seem
to get an answer out of the help files.
For each record that are to be printed in a report does the format event fire
first and then the print even and ony then does the report go to the next
record? The question comes from the following code found on Microsoft's site
in an article on creating dynamic crosstabs:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' Put values in text boxes and hide unused text boxes.
Dim intX As Integer
' Verify that you are not at end of recordset.
If Not rstReport.EOF Then
If Me.FormatCount = 1 Then
For intX = 1 To intColumnCount
' Convert Null values to 0.
Me("Col" + Format(intX)) = xtabCnulls(rstReport(intX - 1))
Next intX
' Hide unused text boxes in the "Detail" section.
For intX = intColumnCount + 2 To conTotalColumns
Me("Col" + Format(intX)).Visible = False
Next intX
' Move to next record in recordset.
rstReport.MoveNext
End If
End If
End Sub
It seems to me that the code overwrites the values of the textboxes before
they print?
Thanks,
Aaron
to get an answer out of the help files.
For each record that are to be printed in a report does the format event fire
first and then the print even and ony then does the report go to the next
record? The question comes from the following code found on Microsoft's site
in an article on creating dynamic crosstabs:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' Put values in text boxes and hide unused text boxes.
Dim intX As Integer
' Verify that you are not at end of recordset.
If Not rstReport.EOF Then
If Me.FormatCount = 1 Then
For intX = 1 To intColumnCount
' Convert Null values to 0.
Me("Col" + Format(intX)) = xtabCnulls(rstReport(intX - 1))
Next intX
' Hide unused text boxes in the "Detail" section.
For intX = intColumnCount + 2 To conTotalColumns
Me("Col" + Format(intX)).Visible = False
Next intX
' Move to next record in recordset.
rstReport.MoveNext
End If
End If
End Sub
It seems to me that the code overwrites the values of the textboxes before
they print?
Thanks,
Aaron