dominicdunmow
Technical User
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
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