Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    OrderBy specified in OnOpen event not taking effect

    I've tried setting the OrderBy property as well as specifying "Ascending" on the LedDate field in the RecordSource query, but I cannot get the report to sort on the "Date Paid" column. See screenshots. The format specifications for both the field def and textbox is mm/dd/yyyy.



    Click image for larger version. 

Name:	00.jpg 
Views:	8 
Size:	13.0 KB 
ID:	24135

    Click image for larger version. 

Name:	01.jpg 
Views:	8 
Size:	88.7 KB 
ID:	24136

    Am I missing something peculiar to sorting on date fields?

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you need to understand about the order of events - when the open event fires, data is not loaded. see this link for more information

    https://support.office.com/en-us/art...7-ce86553682f9

    you can set the filter in the open event, but triggering the filter (filteron) will have no effect.

    And why not just sort it in your query? It will be faster than sorting a form

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    MS Access Reports have their own Sorting and Grouping and ignore that of the RecordSource.

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I'd completely forgotten about that. So use to dealing with forms, queries and DAO recordsets in code that I totally missed that. (See what you guys have to look forward to as your brain begins to age)
    Thanks,
    Bill

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-12-2015, 03:43 PM
  2. Replies: 3
    Last Post: 12-22-2014, 11:57 AM
  3. AllowDeletion Property on OnOpen event
    By excellenthelp in forum Access
    Replies: 2
    Last Post: 11-18-2014, 08:31 AM
  4. How Can I: OrderBy inside an Other OrderBy
    By RichardAnderson in forum Forms
    Replies: 1
    Last Post: 08-23-2013, 01:04 PM
  5. Replies: 2
    Last Post: 01-22-2013, 10:39 PM

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