Results 1 to 5 of 5
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195

    Order by Text box on Report

    Hi Guy's hope you are all safe and well, this should be my last challenge before Christmas and all the best to all....



    I have a field on a report in which I have split the field into 2, one is called SoNumber (field from table) in the SO Number i will have something like:

    SL-123456 (always 6 digits after SL-)

    I have copied the text box and placed it to the right of it in the detail section of the report and done the following:

    Left hand text box now has control source of: =Left([SONumber],6)

    Right hand text box has a control source = = Mid([SONumber,7)

    I now want to be able to sort by the right text box if this is possible ? as it is not listed in the sort by options

    So the full number could be SL-248952 and next Record could be SL-249018, now the one that starts in 249 is actually a lower number because of the last 3 digits 018 and 952

    Hope i have made sense and not mashed your brains

    Kindest

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,421
    In order to get those calculated fields in the sort options, they'll have to be included in the report recordsource.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    yes, put them in the query. map the text boxes to those new fields.
    add the sort field to the report.

  4. #4
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Okay guys thank you, i think may add a field to the backend called something light SLRight the run an update query using the Mid option etc...

    Its sounds like the way to go ?

    Kindest and stay safe

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,421
    No, no. Don't store calculated fields in the table. Apparently you have the table set as the recordsource for the report. Make a query based on the table and add the two calculated fields to the query, then use the query as the report recordsource. That's what ranman is also saying.

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

Similar Threads

  1. ORDER BY Sorting Integer Field as Text
    By Kluaoha in forum Queries
    Replies: 3
    Last Post: 08-21-2017, 11:01 AM
  2. Searching on Split-Form to ignore order of text
    By Ekhart in forum Programming
    Replies: 1
    Last Post: 09-07-2016, 02:45 PM
  3. Replies: 2
    Last Post: 03-07-2016, 05:02 PM
  4. Report in calendar order
    By khartoum in forum Access
    Replies: 5
    Last Post: 03-27-2012, 02:45 AM
  5. Replies: 7
    Last Post: 10-03-2011, 12:44 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