Skip to main content
December 29, 2006
Question

displaying next cell ID on access

  • December 29, 2006
  • 6 replies
  • 497 views
I'm running an Access database with an Auto number ID column to tag my entries. I have an "insert form" which I use to enter new records on the table but I don't know the assigned ID number until after the record is entered. Can I have a field on the "insert form" which displays the ID number as I'm entering the data?
This topic has been closed for replies.

6 replies

January 17, 2007
Got it!.... Thank you very much. As simple as this seemed it made world of difference in my app.
Inspiring
December 29, 2006
So let's just say I want to make my life difficult.....
I'm still open for an answer if anyone knows a way.

If you can explain what you are trying to do, we maybe able to provide
some better ideas to accomplish it.

You can get the highest ID currently in the database with the following
select.

SELECT max(IDField)
FROM aTable

You could then assume that the next number used will be one higher then
this number. Of course that will sometimes be a wrong assumption. If
one more more records that came after the current max id have been
deleted the auto number will not reuse their id values, but rather use
the next value never to have been assigned.

You did say you wanted a difficult life.
December 29, 2006
So let's just say I want to make my life difficult.....
I'm still open for an answer if anyone knows a way.
Inspiring
December 29, 2006
If it's an autonumber in your db, you don't need to know the next value in advance in order to enter a record. If you need the value for anything else, it's better to get it after the insert.
December 29, 2006
For the application I'm running, I would need to know the ID number or at least a tag number of some sort while I'm entering the data. Even if it's a bad idea. Is there a way to display "the next ID number or any number for that matter" incremented on a form that insert information on the table.

I'll take suggestions aswell if you kow better ways of tagging entries while entering them
Inspiring
December 29, 2006
Yes you can, but it's a bad idea so why bother?