If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Report sorting when selection criteria via form
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! |
#2
|
|||
|
|||
Report sorting when selection criteria via form
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. -- Duane Hookom Microsoft Access MVP "Dennis" wrote: 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! |
Thread Tools | |
Display Modes | |
|
|