Simulated Autonumber using Dmax question

P

Phil

I am working with a database outside of my control. It has a particular
table with a unique number field, which is updated by code. the "next
number available" is kept in a seperate table, and for various reasons,
I can not use this nor count on it.

Those in control were nice enough to to increment that number up far,
and give me window several thousand wide for my own nefarious purposes.

I want to use DMax in order to set this up, and it appears it will do
it. My questions are:

1) I can use Dmax("[Note_id]", "tblNOTES","[SRCTABLE]='Item' and
[Note_id]<25000')+1

to give me the next available entry in the table where 25000 is the top
of my window?

2) This would be running in an append QUERY, so given five or ten
records to be appended, each of these would be properly incremented?
 
G

Guest

What you are proposing will work if you are entering one record at a time.

It won't work if two or more people are adding records at about the same
time.

Also it will not work with an append query that enters more than one record
at a time. To append multiple records you will need to do it in code with a
loop so that the number has a chance to increment properly.
 

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