Results 1 to 3 of 3
  1. #1
    uoghk is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    149

    Form's OrderBy not work

    I only set a form's Record Source to a table "Register" as below photo, and no other settings.
    Click image for larger version. 

Name:	pic2.png 
Views:	21 
Size:	9.9 KB 
ID:	50388
    I then code a "Refresh" button to filter by a date and order by mobile no. as below:
    Code:
    Me.Filter = "ReDate=#" & Me.ReDate & "#"
    Me.OrderBy = "Mobile"
    The result screen as below:
    Click image for larger version. 

Name:	pic1.png 
Views:	21 
Size:	57.5 KB 
ID:	50389
    The Filter is OK, it shows all records on request date.
    But the Order does not work, it does not sort by Mobile no.
    I also try to set Me.OrderBy="PatientNo DESC", it also show the same order as in above photo.
    It seem that it always show the current order, no matter how I set the Me.OrderBy


    Thanks

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Change your recordsource (yellow on your image):
    Select * From Register Order By Mobile

    Alternately, you might try what you have, but remove the quotes from "Mobile"

  3. #3
    uoghk is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    149
    Thanks davegri.
    I use your suggection to change the recordsource to "select * from register", then it works.

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

Similar Threads

  1. Replies: 8
    Last Post: 09-25-2019, 11:35 AM
  2. Form OrderBy Asking for Parameter
    By avalentini in forum Forms
    Replies: 5
    Last Post: 08-01-2018, 01:03 PM
  3. Form.OrderBy
    By RayMilhon in forum Forms
    Replies: 1
    Last Post: 09-08-2016, 01:14 PM
  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. 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