Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    I would have expected 8.1.5 to come out as 8010500 not 80105 - looks like you have set the subparalevels based on the current record, so changes for each record. In this example it should be 3 for each row

  2. #17
    Mick99 is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Jul 2015
    Posts
    58
    Just doesn't seem to matter how I change it I just can seem to get it to pick up the last digits, I'm not very good with this. Any suggestions.

    Cheers Mick

    MASTERSORTTEST: Format(Int(Val([Agenda Item Number])),"0000") & Format(Val(Mid([Agenda Item Number],InStr([Agenda Item Number],".")+1)),"00.00.00")

    8.1.5.7 turns into 000801.50.00

  3. #18
    Mick99 is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Jul 2015
    Posts
    58
    Hi still can not get this to work, I have added some screen shot as I must be doing something wrong.
    Click image for larger version. 

Name:	ParaSort 1.PNG 
Views:	12 
Size:	3.8 KB 
ID:	21493
    Click image for larger version. 

Name:	ParaSort 2.PNG 
Views:	12 
Size:	12.0 KB 
ID:	21494
    Click image for larger version. 

Name:	ParaSort 3.PNG 
Views:	13 
Size:	9.8 KB 
ID:	21495

    Cheers Mick

  4. #19
    IrogSinta is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    103
    Here's a revision to the function Ajax posted. Give it a try:
    Code:
    Public Function ParaSort(PNum As String, SubParaLevels As Integer) As Long
        Dim Strarray() As String
        Dim i As Integer
        Dim NStr As String
        
        Strarray = Split(PNum, ".")
        NStr = ""
        
        For i = 0 To UBound(Strarray)
            NStr = NStr & Format(Strarray(i), "00")
        Next i
    
        For i = UBound(Strarray) To SubParaLevels - 1
            NStr = NStr & "00"
        Next i
    
        ParaSort = Val(NStr)
    
    End Function
    Ron

  5. #20
    Mick99 is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Jul 2015
    Posts
    58
    Hi Ron, I must be doing something wrong. I have just put together a sample DB attached of what I am needing to do. I figured it might be easier to work out what I am doing wrong if you have a working model.

    Sequencial Numbering.accdb

    Cheers Mick

  6. #21
    IrogSinta is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    103
    Well a big problem is the fact that you weren't making use of the ParaSort function in your query. Here's the SQL of what your query should look like:
    SELECT [Agenda Item Number], ParaSort([Agenda Item Number],3) AS MASTERSORT FROM [tbl MASTER DATA];

    Ron

  7. #22
    Mick99 is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Jul 2015
    Posts
    58
    All good now, I was not calling the ParaSort at all as you pointed out. I used the updated code you gave me and all works a treat. A massive thankyou RON.

    Cheers Mick

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Tricky question
    By Xipooo in forum Access
    Replies: 5
    Last Post: 03-14-2014, 11:13 AM
  2. subform a little tricky
    By buckwheat in forum Access
    Replies: 5
    Last Post: 09-11-2013, 01:05 PM
  3. Tricky SQL Question
    By ttocsmi in forum Queries
    Replies: 8
    Last Post: 10-01-2012, 10:04 AM
  4. Tricky Analysis??
    By stumped in forum Queries
    Replies: 2
    Last Post: 09-13-2012, 01:59 AM
  5. Sequencial numbering
    By spQQky in forum Forms
    Replies: 1
    Last Post: 01-27-2012, 03:16 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