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

Entire report populated with last record of recordset.

Status
Not open for further replies.

rookie52

Programmer
Sep 29, 2004
7
0
0
AU
Hi Everyone,

Hopefully this is a simple question for all you gurus out there...

1. The code below populates a report, but nothing except the last record is displayed. So at the moment I have a report 12 pages long displaying only one record. How do I make sure the other records are also displayed?

2. I can't really tell if it works yet becuase all the records in the report are the same, but have I used the "PageBreak" property correctly?


Do While Not rst.EOF
Me.sec_role1.Caption = rst.Fields(4)
Me.sec_role2.Caption = rst.Fields(5)
Me.UserID.Caption = rst.Fields(6)
Me.UserName.Caption = rst.Fields(7)

rst.MoveNext
If Not rst.EOF Then
If rst.Fields(1) = "Y" Then
'Me.Detail.ForceNewPage
'Me.PageFooterSection.ForceNewPage = aftersection
Me.PageBreak1.Visible = True
End If
End If
Loop

Thanks!
 
I have not programmed in Access for about 18 months now so I may be a little rusty. But I do believe you need to define your recordset to a variant variable then move to the begining of the recordset then loop.

I hope this helps


Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top