Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    173

    Unanswered: Open Report Using a Forms Filter - and Sort

    I am using the code below to open a report based on the filter of a form

    DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter

    users may filter for a particular company, then sort by date

    how can I also open the report to be sorted the same as the form is?

    Thanks! - AB

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Well....I suppose you could utilize the Report's OpenArgs parameter and the Report's OrderedBy property. Maybe try this:

    DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter, ,"your OrderedBy String"

    Then in the OnOpen event of your Report you could have something like this:

    Code:
    If Len(Me.OpenArgs) > 0 Then
       Me.OrderedBy = Me.OpenArgs
       Me.OrderedByOn = True
    End If
    Hmmm....yup that should do it

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •