Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Automatically Generate Number On Form

Discussion in 'Information Technology' started by jmpinto@lycos.com, Nov 15, 2005.

  1. jmpinto@lycos.com

    jmpinto@lycos.com
    Expand Collapse
    Guest

    I have a field on a form that I would like to automatically generate a
    number, in sequential order, each time a new record is created, and be
    stored in a field. The problem is that I do not want this field to be
    an autonumber field because if a new record is opened by mistake and
    then not used, the autonumber's field would not be in sequential order
    any more. Is there a way to do this? Maybe something along the lines
    of matching the actual record number that is displayed by the record
    selection buttons at the bottom of the page? Any ideas on this would
    be greatly appreciated. Thanks!
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Punjab to use vacant land to generate revenues (New Kerala) Breaking News Feb 19, 2008

  3. Fred Boer

    Fred Boer
    Expand Collapse
    Guest

    Hello:

    Here's a link that might help. The sample databases illustrate how to create
    a sequential number...

    http://www.rogersaccesslibrary.com/download3.asp?SampleName=AutonumberProblem.mdb

    HTH
    Fred Boer

    <jmpinto@lycos.com> wrote in message
    news:1131995416.780114.72970@g49g2000cwa.googlegroups.com...
    >I have a field on a form that I would like to automatically generate a
    > number, in sequential order, each time a new record is created, and be
    > stored in a field. The problem is that I do not want this field to be
    > an autonumber field because if a new record is opened by mistake and
    > then not used, the autonumber's field would not be in sequential order
    > any more. Is there a way to do this? Maybe something along the lines
    > of matching the actual record number that is displayed by the record
    > selection buttons at the bottom of the page? Any ideas on this would
    > be greatly appreciated. Thanks!
    >
     
  4. paul@bullschmidt.com

    paul@bullschmidt.com
    Expand Collapse
    Guest

    I've got a free sample Access invoices database that does this on the
    invoice form (frmInv) that you can download from my site and possibly
    use as a starting point for your database:

    www.Bullschmidt.com/Access

    And the trick to making it work is this in frmInv's InvNum control's
    DefaultValue property:

    =Nz(DMax("[InvNum]","tblInv"))+1

    Best regards,
    J. Paul Schmidt, Freelance Web and Database Developer
    http://www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

    >I have a field on a form that I would like to >automatically generate a
    >number, in sequential order, each time a new record >is created, and be
    >stored in a field. The problem is that I do not want >this field to be
    >an autonumber field because if a new record is >opened by mistake and
    >then not used, the autonumber's field would not be in >sequential order
    >any more. Is there a way to do this? Maybe >something along the lines
    >of matching the actual record number that is >displayed by the record
    >selection buttons at the bottom of the page? Any >ideas on this would
    >be greatly appreciated. Thanks!
     
  5. jmpinto@lycos.com

    jmpinto@lycos.com
    Expand Collapse
    Guest

    Paul,

    The DMax command did the trick! I appreciate it! :) Take care!


    Jonathan

    paul@bullschmidt.com wrote:
    > I've got a free sample Access invoices database that does this on the
    > invoice form (frmInv) that you can download from my site and possibly
    > use as a starting point for your database:
    >
    > www.Bullschmidt.com/Access
    >
    > And the trick to making it work is this in frmInv's InvNum control's
    > DefaultValue property:
    >
    > =Nz(DMax("[InvNum]","tblInv"))+1
    >
    > Best regards,
    > J. Paul Schmidt, Freelance Web and Database Developer
    > http://www.Bullschmidt.com
    > Access Database Sample, Web Database Sample, ASP Design Tips
     

Share This Page