Report sorting when selection criteria via form

G

Guest

In Access2002, I've opened a report ("DoComd.OpenReport") using the selection
criteria as part of the open command (not a FILTER but as the WHERE). What I
need to do now is add a way to sort the report by a user-selected set of
fields. I have three fields on the form, and the user can enter a "1", a "2"
or a "3" in the fields to denote what order they want the report sorted in.
So we can have up to three sort criteria, and various arrangements.

Now, how can I pass the sort criteria to the report using that same DOCMD
syntax. I attempted to add the "ORDER BY" string I built to the end of the
other string, but it won't work. Any thoughts or ideads would be most welcome.

Thanks!
 
G

Guest

IMHO don't use the Order By property as it is always over-ridden by the
sorting and grouping levels. You can manipulate the sorting and grouping
using the solution found at Allen Browne's web site
http://www.allenbrowne.com/ser-33.html.

FYI: the WHERE CONDITION of the DoCmd.OpenReport method automatically sets
the FILTER property. This is a very good method for applying a filter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top