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

MS Access Report Detail Move Next

Status
Not open for further replies.

oldwen

Programmer
Dec 2, 2003
23
US
Does anyone know how to tell the MS Access Report Detail Section to move to the next record for the On Print command. I am looping through a recordset, but the section detail never moves next so to speak so I only end up with one detail record with the last recordset item from the loop. Here is my code. Any ideas?

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim db As Database
Dim rs As Recordset

On Error Resume Next

Set db = CurrentDb
Set rs = db.OpenRecordset("Orlando")

Dim i As Long

i = 1

Do While Not rs.EOF

rs.Move i

Me.txtFname = rs.Fields("fname")
Me.txtLname = rs.Fields("lname")
Me.txtCompanyName = rs.Fields("Company")
Me.txtTitle = rs.Fields("Title")

rs.MoveNext

Me.txtFname2 = rs.Fields("fname")
Me.txtLname2 = rs.Fields("lname")
Me.txtCompanyName2 = rs.Fields("Company")
Me.txtTitle2 = rs.Fields("Title")

rs.MoveNext

i = i + 2

Loop

rs.Close

Set db = Nothing
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top