Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with crosstab query/ report

Status
Not open for further replies.

RexJacobus

Programmer
Dec 10, 2001
47
NZ
I am having problems using a crosstab query in a report. The preview looks good but when the report prints the last record from one page is the top record on the next and the last overall record gets dropped. Here's my code.

If Not rstReport.EOF Then
If Me.FormatCount = 1 Then
For intX = 1 To intColumnCount
Select Case intX
Case 1
'xtabCNulls converts Nulls to 0.
sName = " " & xtabCnulls rstReport(intX - 1))
Case 2
Me("txtUser") = xtabCnulls(rstReport(intX - 1)) & sName
sName = sName
Case 3

Case Else
iData = xtabCnulls(rstReport(intX - 1))
If iData < 420 Then
Me(&quot;txt&quot; + Format(intX)) = iData
Me(&quot;txt&quot; + Format(intX)).FontWeight = (800)
Else
Me(&quot;txt&quot; + Format(intX)) = &quot;Y&quot;
Me(&quot;txt&quot; + Format(intX)).FontWeight = (100)
End If
End Select
Next intX

' Hide unused text boxes
For intX = intColumnCount + 2 To conTotalColumns
Me(&quot;txt&quot; + Format(intX)).Visible = False
Next intX
rstReport.MoveNext

End If
End If

If anyone could tell me what is wrong with my report I would appreciate it.

Thanks,

jim
 
Jim,

I dont understand why you are trying to control the recordset yourself within the report, or why you are testing the formatcount property of the report.

Have a look at the following thread. It relates to some help a gave someone else a short time ago. He's essentially also reporting off a crosstab query, and needing to control the report headings, and association between report fields, and the query fields.

thread181-244508

I hope that this helps. If you need further clarification, let me know
Cheers,
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top