Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After I perform an AddNew method to

Status
Not open for further replies.

waltp9999

Programmer
Jun 17, 2002
32
US
After I perform an AddNew method to a data recordset, how do I get the recordnumber for the record just added? I can't find any properties nor methods that allows direct record number access.

Ideally, after the AddNew, I want to add the data to the record, perform the Update, the position that record near the top of the MSFlexGrid so I'm looking for equivalent to:

ListBox.TopIndex
ListBox.ListIndex

for the data control and/or grid

Thanks,
Walt
 
Hi,

You can retrieve the ID of the last inserted record by:
----------------------------------------------------------
rs.open "SELECT @@IDENTITY", YourConnection
LastID = rs.fields(0)
rs.close
---------------------------------------------------------- Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top