Results 1 to 6 of 6
  1. #1
    vazdajic is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    95

    Sort subform records on a main form

    Hello there..
    As a picture below explains, I will just thank to everyone who will reply to this. Thanks.

    Click image for larger version. 

Name:	Sort subform records on a main form.jpg 
Views:	11 
Size:	268.8 KB 
ID:	32349

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    text will not sort like numbers.
    in the query you can get close by converting it to a 'number':
    val([weld])

    or
    actually alter the field type to a number.

  3. #3
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    As Ranman has already said you can't do this with your current data as its text so sorted one character at a time

    Ideally convert to number field but you'd need to alter 2/1 , 3R1 etc
    Alternatively, have an additional (hidden?) number field so 2/1 becomes 21, 3R1 becomes 31 etc ... but that will give yet another sort order
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    Join Date
    Apr 2017
    Posts
    1,792
    The only option remaining is an additional column (as you have also values like "2/1", this must be text, and you don't show this column anywhere in forms - it is for ordering/sorting only), where same numbers are with leading zeros, like "01", "02", "02/1" etc. (you have to estimate the biggest possible number, to determine the number of leading zeros - in case it is p.e.1000, you must have numbers like "0001", "0002", "0002/1" etc.).

  5. #5
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    you must have numbers like "0001", "0002", "0002/1" etc
    You obviously mean text that looks like numbers as none of these are numbers
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  6. #6
    vazdajic is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    95
    Yeah, I have numbers saved as text. Acc. to QC rules, I am not allowed to have zeroes visible (e.g. 01, 001 etc). Also, sometimes I have letters in weld number field.. Hm.. Thanks for advices..

    For now, I will define additional numeric field which I will use just to sort values. It will be visible on my form but not on reports.

    Thanks everyone.

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

Similar Threads

  1. Replies: 19
    Last Post: 09-25-2015, 10:26 PM
  2. Subform not gathering all records from Main Form
    By compstudent in forum Access
    Replies: 1
    Last Post: 03-05-2015, 01:07 PM
  3. Replies: 3
    Last Post: 06-02-2012, 07:39 PM
  4. Replies: 16
    Last Post: 02-13-2012, 03:32 PM
  5. Replies: 0
    Last Post: 07-26-2010, 04:36 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