MS Access w/ Insert + Select

  • Thread starter Thread starter Prince
  • Start date Start date
P

Prince

Hi, I hava an Access table with the ID field being
autonumbered. Is is possible to write an INSERT query that
returns the ID that was generated for that particular
record? If so, how. From the readings I've been doing it
seems like SQL Server can do it but not ACCESS.

For example, the table name is Test with two fields.
ID ==> autonumber
Text ==> Text

What will the Query look like, if it is indeed possible.

thanks,
Prince
 
¤ Hi, I hava an Access table with the ID field being
¤ autonumbered. Is is possible to write an INSERT query that
¤ returns the ID that was generated for that particular
¤ record? If so, how. From the readings I've been doing it
¤ seems like SQL Server can do it but not ACCESS.
¤
¤ For example, the table name is Test with two fields.
¤ ID ==> autonumber
¤ Text ==> Text
¤
¤ What will the Query look like, if it is indeed possible.

See the following MS KB article:

HOW TO: Retrieve the Identity Value While Inserting Records into Access Database By Using Visual
Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;815629


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top