Results 1 to 3 of 3
  1. #1
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125

    Carrying over sort to report

    I've got a continuous form that opens basically as a report layout. It has print preview button on it that takes the user to a preview of a report representation of the data. In the code for this button I have already made it so that any filters put on during the form view would be carried over when the report is opened i.e.

    Code:
    DoCmd.OpenReport "rptBacklog", acViewPreview, , Me.Filter
    However I found out that this of course doesn't carry over any sorts. I was wondering how to carry that over as well. Is it as simple as "Me.OrderBy"? If so, how would I lay it out? This doesn't seem to be quite right:

    Code:
    DoCmd.OpenReport "rptBacklog", acViewPreview, , Me.Filter & Me.OrderBy
    Thanks.

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    I'm not sure about OrderBy. Could you not just add a field to your table called "Sort" and have that an autonumber field or something, then just sort by that field for everything? That would keep your sort universal.

  3. #3
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125
    From what I've seen there's not an easy way to carry over an open user defined sort. You can do it if you know what's being sorted, however it can't work the same way as my filter statement currently is. I'm going to go back to the drawing board on my reports and add quite a few features later to get around this.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. report grouping and sort
    By Meccer in forum Access
    Replies: 1
    Last Post: 01-05-2011, 08:30 AM
  2. sort data in the report
    By rawandjamal in forum Reports
    Replies: 1
    Last Post: 12-23-2010, 07:07 PM
  3. Report Based on Form - Sort
    By jeffyyy in forum Reports
    Replies: 1
    Last Post: 10-16-2010, 06:15 PM
  4. Replies: 5
    Last Post: 08-24-2010, 02:32 PM
  5. How to sort by three sort orders
    By captgnvr in forum Access
    Replies: 4
    Last Post: 11-09-2009, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums