elvenmaiden
Programmer
Trying to hard code a report based on a recordset. Problem with obtaining more than one record in the details section of the report.
I tried without a loop and with a loop. Without a loop I get the first record of the recordset - with a loop I get the last record of the recordset.
Is there some kind of carriage return or reassignment of information needed? Please help. Thanks!!!
Below is the code for the detail section with the loop structure commented out.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intX As Integer
'verify that not at end of recordset
If Not rsSalesHours.EOF Then
'ensures FormatCount is not showing hold for next page
If Me.FormatCount = 1 Then
'Do Until rsSalesHours.EOF
'fill detail text boxes
For intX = 1 To mintColumnCount
Me("Detail" + Format$(intX)) = rsSalesHours (intX - 1)
Next intX
'hide unused text boxes in detail section
For intX = (mintColumnCount + 2) To 16
Me("Detail" + Format$(intX)).Visible = False
Next intX
'move to next record
rsSalesHours.MoveNext
'Loop
End If
End If
End Sub
I tried without a loop and with a loop. Without a loop I get the first record of the recordset - with a loop I get the last record of the recordset.
Is there some kind of carriage return or reassignment of information needed? Please help. Thanks!!!
Below is the code for the detail section with the loop structure commented out.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intX As Integer
'verify that not at end of recordset
If Not rsSalesHours.EOF Then
'ensures FormatCount is not showing hold for next page
If Me.FormatCount = 1 Then
'Do Until rsSalesHours.EOF
'fill detail text boxes
For intX = 1 To mintColumnCount
Me("Detail" + Format$(intX)) = rsSalesHours (intX - 1)
Next intX
'hide unused text boxes in detail section
For intX = (mintColumnCount + 2) To 16
Me("Detail" + Format$(intX)).Visible = False
Next intX
'move to next record
rsSalesHours.MoveNext
'Loop
End If
End If
End Sub