Welcome to SPN

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

Sign Up Now!

Auto Increment Number

Discussion in 'Information Technology' started by Rusty, Jul 28, 2006.

  1. Rusty

    Rusty
    Expand Collapse
    Guest

    Can I make Access Auto Increment a 4 digit number at the next blank form. ie

    When I start the secession I will type in the Visual Id #, say it is "7643".
    Then when the record is saved and a new blank one opened, I would like the
    form to open with a 7644 number already in the "VID" field.
    --
    Rusty
     
  2. Loading...

    Similar Threads Forum Date
    Opinion Is Autocomplete Evil? Some Women Take A Hard Look at Google ! Breaking News Nov 7, 2013
    Sikh News AutoZone sued for firing Everett Sikh Breaking News Sep 29, 2010
    India Singh: Centre Ready To Give Kashmir Autonomy Breaking News Aug 11, 2010
    India Paste tariff cards behind driver’s seat: Transport dept to automen Breaking News Jul 21, 2010
    Gursharan Kaur: India's First Lady's Autobiography Sikh Personalities Jun 1, 2010

  3. BruceM

    BruceM
    Expand Collapse
    Guest

    For one method (watch out for line wrapping in your newsreader window):
    http://www.rogersaccesslibrary.com/download3.asp?SampleName=AutonumberProblem.mdb

    "Rusty" <Rusty@discussions.microsoft.com> wrote in message
    news:5E82B7B3-6849-44AB-81BA-6B269C0BA5AD@microsoft.com...
    > Can I make Access Auto Increment a 4 digit number at the next blank form.
    > ie
    >
    > When I start the secession I will type in the Visual Id #, say it is
    > "7643".
    > Then when the record is saved and a new blank one opened, I would like the
    > form to open with a 7644 number already in the "VID" field.
    > --
    > Rusty
     
  4. Joseph Meehan

    Joseph Meehan
    Expand Collapse
    Guest

    Try:

    If Me.NewRecord Then

    Me!NameOfField = Nz(DMax("YOURFIELDNAME","TABLENAME"), 0) + 1

    End If

    Replace the 0 if you want a different starting number


    The following can be used to format the field with letters preceding the
    number like ABC

    =Format(NumField, "\A\B\C\-0000")

    --
    Joseph Meehan

    Dia duit
    "Rusty" <Rusty@discussions.microsoft.com> wrote in message
    news:5E82B7B3-6849-44AB-81BA-6B269C0BA5AD@microsoft.com...
    > Can I make Access Auto Increment a 4 digit number at the next blank form.
    > ie
    >
    > When I start the secession I will type in the Visual Id #, say it is
    > "7643".
    > Then when the record is saved and a new blank one opened, I would like the
    > form to open with a 7644 number already in the "VID" field.
    > --
    > Rusty
     
  5. Rusty

    Rusty
    Expand Collapse
    Guest

    Where do I put that code. In the Lookup section of the Table or in the form?
    --
    Rusty


    "Joseph Meehan" wrote:

    > Try:
    >
    > If Me.NewRecord Then
    >
    > Me!NameOfField = Nz(DMax("YOURFIELDNAME","TABLENAME"), 0) + 1
    >
    > End If
    >
    > Replace the 0 if you want a different starting number
    >
    >
    > The following can be used to format the field with letters preceding the
    > number like ABC
    >
    > =Format(NumField, "\A\B\C\-0000")
    >
    > --
    > Joseph Meehan
    >
    > Dia duit
    > "Rusty" <Rusty@discussions.microsoft.com> wrote in message
    > news:5E82B7B3-6849-44AB-81BA-6B269C0BA5AD@microsoft.com...
    > > Can I make Access Auto Increment a 4 digit number at the next blank form.
    > > ie
    > >
    > > When I start the secession I will type in the Visual Id #, say it is
    > > "7643".
    > > Then when the record is saved and a new blank one opened, I would like the
    > > form to open with a 7644 number already in the "VID" field.
    > > --
    > > Rusty

    >
    >
    >
     
  6. BruceM

    BruceM
    Expand Collapse
    Guest

    The link I sent contains this information. It goes into the field's default
    value, which can be set in the text box bound to the field.

    "Rusty" <Rusty@discussions.microsoft.com> wrote in message
    news:B17CE178-940B-4863-A2BD-20C28F2F7624@microsoft.com...
    > Where do I put that code. In the Lookup section of the Table or in the
    > form?
    > --
    > Rusty
    >
    >
    > "Joseph Meehan" wrote:
    >
    >> Try:
    >>
    >> If Me.NewRecord Then
    >>
    >> Me!NameOfField = Nz(DMax("YOURFIELDNAME","TABLENAME"), 0) + 1
    >>
    >> End If
    >>
    >> Replace the 0 if you want a different starting number
    >>
    >>
    >> The following can be used to format the field with letters preceding the
    >> number like ABC
    >>
    >> =Format(NumField, "\A\B\C\-0000")
    >>
    >> --
    >> Joseph Meehan
    >>
    >> Dia duit
    >> "Rusty" <Rusty@discussions.microsoft.com> wrote in message
    >> news:5E82B7B3-6849-44AB-81BA-6B269C0BA5AD@microsoft.com...
    >> > Can I make Access Auto Increment a 4 digit number at the next blank
    >> > form.
    >> > ie
    >> >
    >> > When I start the secession I will type in the Visual Id #, say it is
    >> > "7643".
    >> > Then when the record is saved and a new blank one opened, I would like
    >> > the
    >> > form to open with a 7644 number already in the "VID" field.
    >> > --
    >> > Rusty

    >>
    >>
    >>
     

Share This Page