jonesaj5
asked on
Quick answer required
How do i get the primary key of the row i have just inserted in Access DB, Anyone know?
Thanks
AjONES.
Thanks
AjONES.
It sounds like you're referring to an Autonumber value.
The key value should be available in the recordset for your form, control, etc. after the data is inserted.
If you're using VBA code try checking the keyfield value in an after_update event procedure.
The key value should be available in the recordset for your form, control, etc. after the data is inserted.
If you're using VBA code try checking the keyfield value in an after_update event procedure.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you are using ADO and a client-side cursor then you might need to do a Recordset.Requery to get the id values.
////////////////////////// //////////
Easy Tracking
////////////////////////// //////////
Assume that you are doing a VB Application connected to an Access 2000 Database, provided you are having your primary key of the table set to 'Auto Number'
try
Adodc1.recordset.movelast
PryKey=.fields("PriKeyFiel dName")+1
Hope it helps.
Cheers.
Easy Tracking
//////////////////////////
Assume that you are doing a VB Application connected to an Access 2000 Database, provided you are having your primary key of the table set to 'Auto Number'
try
Adodc1.recordset.movelast
PryKey=.fields("PriKeyFiel
Hope it helps.
Cheers.
any update jonesaj5?
hello?
...
...
Nic;o)