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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Crosstab Report Problem - How to display all records 1

Status
Not open for further replies.

dominicdunmow

Technical User
Jul 28, 2004
125
CA
Hi there,

I've used the code below to assign control sources to the fields, I have similar code to assign labels, but when I run the report, only the first records appears, the source query has at least 10 records.

Can anyone tell me what I'm doing incorrectly?

Thanks

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim i As Integer
Dim j As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("select * from qxttest")
rst.MoveFirst
j = -1
i = 0
For i = 0 To rst.Fields.Count - 1
j = j + 1
Select Case i
Case 0
Me.[Text0].Value = rst.Fields(i)
Case 1
Me.[Text1].Value = rst.Fields(i)
Case 2
Me.[Text2].Value = rst.Fields(i)
Case 3
Me.[Text3].Value = rst.Fields(i)
Case 4
Me.[Text4].Value = rst.Fields(i)
Case 5
Me.[Text5].Value = rst.Fields(i)
Case 6
Me.[Text6].Value = rst.Fields(i)
Case 7
Me.[Text7].Value = rst.Fields(i)
Case 8
Me.[Text8].Value = rst.Fields(i)
Case 9
Me.[Text9].Value = rst.Fields(i)
Case 10
Me.[Text10].Value = rst.Fields(i)
Case 11
Me.[Text11].Value = rst.Fields(i)
Case 12
Me.[Text12].Value = rst.Fields(i)
Case 13
Me.[Text13].Value = rst.Fields(i)
End Select
skip_it:
Next
rst.Clone
Set rst = Nothing

End Sub
 
Don't use that method/solution. Consider the Crosstab.mdb solution in the download demo from
I'm not sure how your code would know which record to print since it opens the same recordset and moves to the first record every time. Also, does your report have a record source property value?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks for your response, I've done many a search for the anser to this and I notice your name appears nearly everytime. I've been to your website already but couldn't work out how the report worked.

The code I used seemed simpler so I took the easy way out.

I'll study your examples cloesely.

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top