
How do I gett the value of autoincrement field after an .AddNew/.Update
Hi All!
I've got a 2 form datbase inquiry/change/add/delete application
Inquiry and delete take place on the main from with an ADODC control
attached to an
Access database (NWND.MDB) using Jet4.0.
Updates/adds take place on a second form. The .DataSource and .DataField
properties on a series of text boxes is set at run-time in the FormLoad
procedure.
When I add a record using an .AddNew/.Update series of method calls, when
I return to the main from, the Auto-Increment field display a zero in the
associated
databound textbox.
If I then try to delete the added record, I get a runtime error saying I
can't delete the
record as some of the data has changed.
If I exit the program and restart, I can see that the Auto-Increment field
has actually
been updated correctly and I can then delete the record with ease.
I can I force my application to display the proper value in the
autoincrement field
immediately upon adding the record? Ideally, I would like to retreive the
incremented
value immediately after the .Update method call.
I know this has something to do with Cursors and Lock modes, but my VB
teacher
hasn't covered this at all and I'm having trouble making sense out of the
explaination
in the book.
A clue would be vastly appreciated.
adTHANKSvance!
Simeon