Welcome to SPN

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

Sign Up Now!

Make Table Query and AutoNumbers

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

  1. Nicholajlg

    Nicholajlg
    Expand Collapse
    Guest

    Hi, I can't find an answer that is quite right for this but there must
    be a way to do it. Very simply, I have a make table query that is run
    monthly. I want the resulting table to have an autonumber field -
    which later on becomes part of a key for the line item. In the
    meantime though, I can't make the autonumber field any way but
    manually.

    This field should be created automatically when I run the macro that
    runs all of my queries. Barring a delete and then append query, how do
    I do it?

    Thanks!
     
  2. Loading...

    Similar Threads Forum Date
    As A Child, Public Marches Of Sikhism Made Me Uncomfortable. They Still Do . Why ? Whats The Logic Hard Talk Oct 16, 2016
    Arts/Society Backyard Vegetable Garden Language, Arts & Culture Dec 27, 2013
    Heritage Now a Vegetable Market, Ranjit Singh's Royal Haveli a Picture of Neglect History of Sikhism Nov 11, 2013
    Sikhism Helium: 1984 and the "Periodic Table of Hate" (Jaspreet Singh) Book Reviews & Editorials Oct 28, 2013
    Heritage How our entire history was dumped in a horse stable History of Sikhism Oct 28, 2013

  3. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Nicholajlg wrote:
    > Hi, I can't find an answer that is quite right for this but there must
    > be a way to do it. Very simply, I have a make table query that is run
    > monthly. I want the resulting table to have an autonumber field -
    > which later on becomes part of a key for the line item. In the
    > meantime though, I can't make the autonumber field any way but
    > manually.
    >
    > This field should be created automatically when I run the macro that
    > runs all of my queries. Barring a delete and then append query, how do
    > I do it?
    >
    > Thanks!


    A delete, then an append query is about it I'm afraid. AutoNumbers aren't
    the only data type that might not come out the way you want with a MakeTable
    query. They generally should not be used in a production application, but
    only for one-off development stuff.

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  4. Nicholajlg

    Nicholajlg
    Expand Collapse
    Guest

    What is the danger in using autonumbers in production?
    Rick Brandt wrote:
    > Nicholajlg wrote:
    > > Hi, I can't find an answer that is quite right for this but there must
    > > be a way to do it. Very simply, I have a make table query that is run
    > > monthly. I want the resulting table to have an autonumber field -
    > > which later on becomes part of a key for the line item. In the
    > > meantime though, I can't make the autonumber field any way but
    > > manually.
    > >
    > > This field should be created automatically when I run the macro that
    > > runs all of my queries. Barring a delete and then append query, how do
    > > I do it?
    > >
    > > Thanks!

    >
    > A delete, then an append query is about it I'm afraid. AutoNumbers aren't
    > the only data type that might not come out the way you want with a MakeTable
    > query. They generally should not be used in a production application, but
    > only for one-off development stuff.
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
     
  5. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Nicholajlg wrote:
    > What is the danger in using autonumbers in production?


    Not AutoNumbers, MakeTable queries.

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  6. RoyVidar

    RoyVidar
    Expand Collapse
    Guest

    "Nicholajlg" <nicholajlg@yahoo.com> wrote in message
    <1154011793.566593.315160@m73g2000cwd.googlegroups.com>:
    > Hi, I can't find an answer that is quite right for this but there
    > must be a way to do it. Very simply, I have a make table query that
    > is run monthly. I want the resulting table to have an autonumber
    > field - which later on becomes part of a key for the line item. In
    > the meantime though, I can't make the autonumber field any way but
    > manually.
    >
    > This field should be created automatically when I run the macro that
    > runs all of my queries. Barring a delete and then append query, how
    > do I do it?
    >
    > Thanks!


    The counter keyword. Have a look in this reference for more info
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acintsql.asp
    (watch for linebreaks)

    CREATE TABLE MyTable (id COUNTER PRIMARY KEY,
    MyNextField TEXT(25) NOT NULL UNIQUE, ...)"

    Though, I agree there is seldom need to create tables on the fly.

    --
    Roy-Vidar
     

Share This Page