Results 1 to 6 of 6
  1. #1
    avalentini is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    9

    Form OrderBy Asking for Parameter


    Hello,

    I have a form with several subforms whose records I am attempting to display as according to the OrderBy property. I first tried doing this using the Property Sheet, setting the respective Order By properties to "fieldName". Then, I tried using the following code:

    Code:
    Private Sub Form_Current()
    
        Me.OrderByOn = True
        Me.OrderBy = "media_PublicationDate DESC"
    
    
    End Sub
    In both cases, the records were ordered, but the form requested that I first enter a parameter before accessing it. I assume that this parameter is sort of starting point from which the records are then ordered? Is there any way to order forms and subforms without having to deal with this prompt?

    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,738
    What is the recordsource of the form? You might try a query with the Order BY as part of the query.

  3. #3
    avalentini is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    9
    The recordsource is a table - same with the subforms.

    Any idea why it is asking for a parameter? Is this normal with OrderBy?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,738
    Sometimes, Access asks for a parameter because of a spelling mistake.
    Tell us about your tables and the form and subforms.

  5. #5
    avalentini is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    9
    Quote Originally Posted by orange View Post
    Sometimes, Access asks for a parameter because of a spelling mistake.
    . . . it was a spelling mistake.

    Thanks for the simple solution!

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,738

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

Similar Threads

  1. Form.OrderBy
    By RayMilhon in forum Forms
    Replies: 1
    Last Post: 09-08-2016, 01:14 PM
  2. me.orderby with refrence ID
    By pyromaniac511 in forum Programming
    Replies: 16
    Last Post: 06-27-2016, 06:19 PM
  3. How Can I: OrderBy inside an Other OrderBy
    By RichardAnderson in forum Forms
    Replies: 1
    Last Post: 08-23-2013, 01:04 PM
  4. Replies: 1
    Last Post: 02-28-2013, 01:20 PM
  5. Form Filter/OrderBy Issue
    By Gray in forum Forms
    Replies: 2
    Last Post: 05-13-2011, 03:10 PM

Tags for this Thread

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