Results 1 to 4 of 4
  1. #1
    alsoto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    67

    sorting report records at runtime

    Hello,



    I have a parameter form where a user chooses a sort from an option box, values 1-4. I am trying to enter code in the Open Event of the report that will set the OrderBy preoperty at runtime.

    Any help would be greatly appreciated.

    Thanks,
    Al

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is [Forms]![frmPrintMenuNew]![chooseSo] an unbound control? If not then to what type of field is it bound?

  3. #3
    alsoto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    67

    Report OrderBy set at Runtime

    Rural Guy,

    Thank you for responding.Yes, it is an unbound control.

    I got the following to work:

    If Forms!frmPrintMenuNew!chooseSo = "1" Then
    Me.OrderBy = "StartDate, LastName"
    Me.OrderByOn = True
    Else
    If Forms!frmPrintMenuNew!chooseSo = "2" Then
    Me.OrderBy = "LastName"
    Me.OrderByOn = True
    Else
    If Forms!frmPrintMenuNew!chooseSo = "3" Then
    Me.OrderBy = "Program, LastName"
    Me.OrderByOn = True
    Else
    If Forms!frmPrintMenuNew!chooseSo = "4" Then
    Me.OrderBy = "Rep, LastName"
    Me.OrderByOn = True
    End If
    End If
    End If
    End If

    Thank you!
    Al

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Thanks for posting back with your success and solution.

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

Similar Threads

  1. Sorting subform records
    By Remster in forum Forms
    Replies: 4
    Last Post: 11-17-2010, 10:39 AM
  2. Displaying Records & Sorting Help
    By raceware in forum Access
    Replies: 1
    Last Post: 09-29-2010, 06:35 AM
  3. Sorting records
    By Samu77 in forum Access
    Replies: 1
    Last Post: 09-13-2010, 10:40 PM
  4. Sorting Records
    By sfoot0309 in forum Reports
    Replies: 1
    Last Post: 02-05-2010, 05:50 PM
  5. Sorting records
    By BravoEcho in forum Queries
    Replies: 0
    Last Post: 06-23-2009, 04:49 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