Results 1 to 3 of 3
  1. #1
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    Sort button in the Form Header

    I have created a button in the Form header, it was working but not quite.

    When I press the button above, it will sort the list but it will not include the last 3 lines. I tried it ascending and descending on all the columns and the same result comes out, the last 3 lines are not included in the sorting.

    below is the VBA created On Click under event procedure. Please help. Thank you.

    Private Sub Command47_Click()
    If Me.OrderBy Like "*DESC" Then
    Me.OrderBy = "TenderID"
    Else
    Me.OrderBy = "TenderID DESC"
    End If
    Me.OrderByOn = True
    End Sub



    Also attached is the screen shot of the report.

    Click image for larger version. 

Name:	Sort form.PNG 
Views:	5 
Size:	61.5 KB 
ID:	20393

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    what happens if you right click on the tenderid column (any row of data) and sort from there? Does it sort correctly?

  3. #3
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    Sort button in the form header

    When you right click any part of the row of data, this is what it shows,

    Click image for larger version. 

Name:	Sort form right click.PNG 
Views:	4 
Size:	128.4 KB 
ID:	20394

    It does not sort the data, but shows a box as shown above.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-07-2014, 09:16 AM
  2. sort option button
    By turk in forum Access
    Replies: 9
    Last Post: 03-08-2012, 03:16 PM
  3. Button to Sort by Field
    By tylerg11 in forum Programming
    Replies: 4
    Last Post: 10-20-2011, 02:43 PM
  4. Group Header and then a Sort
    By bbulla in forum Reports
    Replies: 1
    Last Post: 09-29-2011, 09:56 AM
  5. Creating Sort Buttons in a Header in a list view
    By marttaaayyy!! in forum Programming
    Replies: 4
    Last Post: 03-29-2010, 11:08 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