
AddNew and Update ADO methods
With an autonumber, anytime you addnew, you increment the number, so yes you
will have a record, that will have your autonumber field, and nothing else
by doing that. One caution though, is to make sure your tables allow for
blank fields, by setting the proper field properties in the design view of
the table itself.
HTH
Wendy
Quote:
>In my application, I've avoiding the use of the ADODC for various
>reasons so I'm reproducing much of the funcionality myself.
>I've got a question about .AddNew and .Update methods, particularly wrt
>Access databases.
>If I add a new record to a recordset without passing any parameters (its
>empty so far) what is contained in the record? The problem is that I've
>got an autonumber field for my primary key. Can I count on having my new
>ID number?
>My current fix is to do the following:
>Dim RS as Recordset
>Dim tmpBookMark As Variant
>RS.addnew
>RS.Update
>tmpBookMark = empRS.Bookmark
>RS.Requery
>RS.Bookmark = tmpBookMark
>Now I don't know if that'll work. Please help.