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

Problem ordering records on a report

Status
Not open for further replies.

badulake1

Programmer
Apr 10, 2002
7
ES
Hi there,

I have (on Access97) a form that has a list that can be reordered on runtime. On the same form I have a button to print the Rowsource of this list item. However, even though the list is ordered, the report always prints in the same order. This is how I open the report:

DoCmd.OpenReport stDocName, acPreview, List.RowSource

The problem is, as I said, the report doesn't show ordered. I tried something else which was to set through vba (after the OpenReport) the OrderBy and OrderByOn properties but nothing happens (guess I should have to refresh the report since it has already been opened). Can anyone help?. Thanks in advance,

Javier
 
order the data in a query and use that query in the report instead of opening a table directly.

HTH,

Shri
 
But List.Rowsource is a query (when messageboxed it reads "select A, B FROM C WHERE D=E ORDER BY A), so I assume I am using a query in the report, not a table (the list is ordered and filtered, however the report is filtered but not ordered). Strange...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top