Creating Unique Line#s in Append Query

C

Chip

Howdy!

I am relatively new to ACCESS databases but I am trying to build an Append
Query in ACCESS and I need the records to have one of the fields (LineNumber)
of the new records filled with an incremental number or line number for each
record each time it generates a set of records. (This number just needs to
be unique and not necessarily sequential as it is just one of the three (3)
primary key fieds of the table that the generated fields are going into.)

The tables of this database are in a SQL database so I do not have all the
freedoms to easily make a change to the table structure.

I have looked elsewhere in these newsroups and Google and do not see
anything that seems to fit this situation. (Or at least that I can understand
if it does)

Any assistance would be greatly appreciated in this matter.

As always THANKS IN ADVANCE!!!

Chip
 
N

NetworkTrade

a new field in your destination table that is defined as an auto number will
do what you want.

when you append to the destination table you do not put in any value for
this field - it is not part of your append query.... after the records are
added/appended to the destination table - go ahead and look at the table and
you will see that this new autonumber field is generating values.
 
C

Chip

Unfortunately, the database is a SQL database and is predifined by a master
software program so I cannot add this autonumber field. I was hoping to
generate the number externally with code or even a random # will work.

THANKS!!!

Chip
 
N

NetworkTrade

if it is a multiple front end environment to that backend table; you need to
implement the table at the back end to avoid duplicates...

with a single front end one could make a module that holds an incrementing
number if you are a programmer...but in which case you probably wouldn't have
asked here for help....

so maybe you should consider creating a local temp table with this new
autonumber field....that is in your frontend only...; first put it into you
temp local table which will generate a nonduplicate auto number; and then
query it from this table and apply/append to your final back end... kind of
a kludgey suggestion but....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top