Results 1 to 3 of 3
  1. #1
    devxweb is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    7

    Problem with function?

    Hey, There's seem to be a problem in either my function or understanding the field in my table. Ok, in the attached file, kindly pls take time to import it and take a look. There is a field, EnrolmentNumber which I cant make sense of WHEN generating a new EnrolmentNumber. one example - 1112OA1482 - The first four numbers are generated by a function, the two middle are just letters from first name and last, and the last four numbers should be higher than the last one < this is where i have a problem. I use this fucntion for the last four numbers:

    Right(DMax("[EnrolmentNumber]","tbl_Students"),4)+1



    The problem is that the last four digits from that field the function gives is 1704, but actually its 1725. Now can you guys export.txtplease identify the prob...thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    The maximum value in that field is 1213YR1703 so the calculation result is 1704. If you want the maximum of the last four digits, swap the functions:

    DMax("Right([EnrolmentNumber],4)","tbl_Students")+1
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    devxweb is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2012
    Posts
    7
    Quote Originally Posted by June7 View Post
    The maximum value in that field is 1213YR1703 so the calculation result is 1704. If you want the maximum of the last four digits, swap the functions:

    DMax("Right([EnrolmentNumber],4)","tbl_Students")+1
    Oh Lord..Thank you June7

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

Similar Threads

  1. Problem with IIF function
    By Hulk in forum Forms
    Replies: 3
    Last Post: 03-20-2011, 12:59 PM
  2. DCount function problem
    By 10 Gauge in forum Forms
    Replies: 5
    Last Post: 02-28-2011, 02:08 PM
  3. VBA Function problem
    By smikkelsen in forum Programming
    Replies: 5
    Last Post: 07-16-2010, 07:46 AM
  4. dlookup function problem
    By bdaniel in forum Programming
    Replies: 3
    Last Post: 04-26-2010, 05:55 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