Results 1 to 5 of 5
  1. #1
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    Show the Last series Number in the form using text box

    I created a form where there is a series number. What I like to do is to show the last used number in the series on a text box beside this.

    How can I do this.



    Thank you.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    A DMax() function may work for you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141
    Quote Originally Posted by pbaldy View Post
    A DMax() function may work for you.
    Dear Mr. PBadly,

    Tried to use DMax or even DLast but still no luck, it always show an error message of "The expression you entered has a function containing the wrong number of arguments.

    in the text box I wrote:

    =DMax([Transmittal No]) or
    =DLast([transmittal No])

    both have the same error message.

    Thanks in advance for your input

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    There are two types of aggregate functions:

    SQL Aggregates - Sum, Avg, Count, etc

    Access Domain Aggregates - DSum, DAvg, DCount, etc

    Domain aggregates have 3 arguments.

    DMax("fieldname", "tablename", "optional where condition")

    Access Help has more info on domain aggregates.

    Use domain aggregate if you want Max value of all records in table. Use in queries, textbox, code.

    Use SQL aggregate if you want Max value of records in the form's recordset. Use in queries or textbox.
    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.

  5. #5
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141
    Quote Originally Posted by June7 View Post
    There are two types of aggregate functions:

    SQL Aggregates - Sum, Avg, Count, etc

    Access Domain Aggregates - DSum, DAvg, DCount, etc

    Domain aggregates have 3 arguments.

    DMax("fieldname", "tablename", "optional where condition")

    Access Help has more info on domain aggregates.

    Use domain aggregate if you want Max value of all records in table. Use in queries, textbox, code.

    Use SQL aggregate if you want Max value of records in the form's recordset. Use in queries or textbox.
    Dear June07,

    thank you for the explanation. It really helps.

    all done and working. cheers.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-07-2013, 01:12 AM
  2. Replies: 4
    Last Post: 11-19-2013, 06:53 PM
  3. Replies: 9
    Last Post: 03-22-2013, 06:37 AM
  4. Replies: 3
    Last Post: 12-22-2012, 05:33 PM
  5. Replies: 7
    Last Post: 10-09-2012, 02:22 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