By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

Return the value of a auto incrementing field from Addnew rec

P: 1
How can I possibly get the value from a newly inserted record in access db where the datafield type is autoincrement? I don't think querying for the newly inserted data is the best solution. or is it? -My application is written in VB using Access as the database.
Oct 27 '06 #1
Share this Question
Share on Google+
2 Replies


Expert 5K+
P: 8,434
How can I possibly get the value from a newly inserted record in access db where the datafield type is autoincrement? I don't think querying for the newly inserted data is the best solution. or is it? -My application is written in VB using Access as the database.
I think you'll find you can read the value of the auto field as soon as you do the AddNew, before doing Update.
Oct 27 '06 #2

PEB
Expert 100+
P: 1,418
PEB
And if really you needto do Update
so you do:
rs.Update
And than

Rs.edit

and you can use, i'm sure the ID autoincrement

:)
Oct 27 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.