View Full Version : What autonumber id did access generate?

01-11-2005, 10:40 PM
Okay I have a table where it has Autonumber field for one of the id's.... :(

I'm designing a messaging system right.... is for 6 users. Members of the public are given the choice to send the users of the system mail. When a member of the public sends a message to a user. The message is created and entered into the "userMessage" table which stores the message id, header, date, body so on.... then i need the message id to put it in the "userInbox" the table that stores username and the message id. This table tells exactly what is in each user's inbox. :confused:

So how do i get the message id that the autonumber created without using another SELECT statement which I think is gonna be extremely inefficient, because what would I put for the where clause? all the other data?
:eek: :eek:

01-12-2005, 05:02 AM
4GuysFromRolla.com : ASP FAQS : Databases, General
How do I get the record number of a just added record, using an Access database table? by Bill Wilkinson - 11/3/2000

ADO FAQ - Q9) How do I get the AutoNumber (or Identity) for a newly inserted record?

INFO: Identity and Auto-Increment Fields in ADO 2.1 and Beyond

INFO: Identity (AutoIncrement) Columns in ADO or RDS

User Tips: Getting the ID of the Just Inserted Database Record by Dan H. - 12/26/2000

01-13-2005, 06:38 AM
Those sites were extremely helpful thanks man!