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
 
check and/or set up values in the sort/order by pop up.
you get to this via view->sorting/grouping menu. Best Regards,
Mike
 
On Access 97 there's no view->sorting/grouping, and if there was I wouldn't want to use it everytime I print a report which source (List.Rowsource) is already filtered and ordered (why re-order?). The filter is applied, however, I can't manage to sort the records using the OrderBy and OrderByOn properties.... it can't be that difficult!!
 
Look again my friend....

Report design, then open view->sorting/grouping Best Regards,
Mike
 
Thanks a bunch Mike. My problem was that since there was already an order there, I couldn't specify one myself (it was ignored). The solution:

1) I deleted all the columns in the order/group list
2) After calling Open Record, I issued the sentence:
Reports![MyReport].OrderBy=Field1

Bye,

Badu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top