G
Guest
I have a crosstab query that will vary by columns and rows anytime it is run.
My column labels work great (wrote similar code in Report Header on Format).
For the test run of the report I have 14 columns and 18 rows. My problem,
the first record repeats 18 times instead of showing me the 18 individual
records. I'm sure its something obvious...I hope you can help!
Here is the code I'm using
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("sel_Trailer Pools")
RST.MoveFirst
j = -1
i = 0
For i = 0 To RST.Fields.Count - 1
j = j + 1
Select Case j
Case 0
Me.unb0 = RST.Fields(i).Value
Case 1
Me.unb1 = RST.Fields(i).Value
etc through 40
End Select
Next i
RST.Close
Set RST = Nothing
End Sub
My column labels work great (wrote similar code in Report Header on Format).
For the test run of the report I have 14 columns and 18 rows. My problem,
the first record repeats 18 times instead of showing me the 18 individual
records. I'm sure its something obvious...I hope you can help!
Here is the code I'm using
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("sel_Trailer Pools")
RST.MoveFirst
j = -1
i = 0
For i = 0 To RST.Fields.Count - 1
j = j + 1
Select Case j
Case 0
Me.unb0 = RST.Fields(i).Value
Case 1
Me.unb1 = RST.Fields(i).Value
etc through 40
End Select
Next i
RST.Close
Set RST = Nothing
End Sub