If you are using SQL server you can encase your query in a <cftransaction> tag and then after your query, SELECT @@identity FROM tbljustinsertedto
I don't believe access supports this, however, you could just SELECT MAX(id) from tbljustinsertedto and that should be that last id. -----Original Message----- From: Kris Pilles [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 8:06 AM To: CF-Talk Subject: Query help How can Insert a record into a table (that I know how to do) but after the insert, I want to be able to know what the primary key for the record I just inserted... ______________________________________________________________________ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

