Assigning Unique Number In A Query

J

Jeff G

Everyone -

I have a query where I'm pulling a set of records. I want to assaign a
sequential number to each of those records. I know that I need to use
DMax(...,...)+1 to get that, but how do I go about looping through the
recordset to assign a unique number to each record?

Is it better to do it through VBA? If so, how do I go about it?

Thanks.

Jeff G
 
J

Jeff Boyce

Jeff

A query is something of an intermediate step along the way somewhere. Where
are you going with this?

A common way to end up with sequential numbering is to put the results of a
query into a report, and use the RunningSum property of a textbox on the
report...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jeff G

I'm using it to assign an Invoice Number. I have a workaround, by appending
to a temp table that the Invoice Nubmer is an Autonumber, but I'd rather do
it via VBA.
 
C

Christopher J. Whyte

Seems like if you set up your tables with an auto number, then it would be
taken care of when the record was created
Then all you would have to do is pull that field up with the other fields!!!
 

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