How about this?
<cfquery Datasource = "DSN_Name" Name = "Query_Name">
SELECT MAX (UserID) AS ID
From Users
</cfquery>
<cfoutput query="Query_Name">
#ID#
</cfoutput>
----- Original Message -----
From: "Angel Stewart" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, September 27, 2001 6:50 AM
Subject: Last Record's Autonumber value.
> Hey all,
>
> How can I tell what the Autonumber value of a record I just inserted is
using Access?
>
> So I enter a User, and then I want to display that user's ID back to them.
> UserID is an Autonumber field, so I don't know it until after I insert.
> I can't search for First name or last name, because those could be
duplicated.
>
> Do I do a Top 1 in a SQl query and wrap the entire thing in a
CFTransaction?
>
> -Gel
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
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