Results 1 to 2 of 2
  1. #1
    jeffyyy is offline Novice
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Posts
    7

    Report Based on Form - Sort

    I have a report based on a query that gets its criteria from a form. I want to put a dropdown or checkbox on the form that will tell the report to sort either by room number or last name, whichever the user selects on the form.



    Thanks for the help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This give you some ideas?

    Code:
    Private Sub Report_Open(Cancel As Integer)
      Select Case Forms!frmReports.fraGrouping
        Case 1 'sort/group on car type
          Me.GroupLevel(0).ControlSource = "CarType"
          Me.txtGroup.ControlSource = "CarDesc"
        Case 2 'sort/group on company
          Me.GroupLevel(0).ControlSource = "Company"
          Me.txtGroup.ControlSource = "Company"
        Case 3 'sort on date/time, no grouping
          Me.GroupLevel(0).ControlSource = "DispDateTime"
          Me.txtGroup.ControlSource = "DispDateTime"
          Me.GroupHeader0.Visible = False
      End Select
    End Sub
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Sort oldest to newest on form
    By Desstro in forum Forms
    Replies: 6
    Last Post: 09-18-2010, 05:35 AM
  2. Replies: 5
    Last Post: 08-24-2010, 02:32 PM
  3. Create a report based on a pop-up form
    By p4ck3tl055 in forum Reports
    Replies: 1
    Last Post: 03-29-2010, 09:38 AM
  4. Access 2003, sort order property of a form
    By Rick West in forum Forms
    Replies: 11
    Last Post: 09-17-2009, 08:28 PM
  5. export to multiple sheets based on change in sort
    By mws5872 in forum Programming
    Replies: 0
    Last Post: 06-30-2009, 07:55 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