this is an old project...
In a table1 have a key autonumber named ID.
now i add new set of fields with:
rs.addnew
...
rs.update
but after update, and without a query, is possible to know the number of new ID key number and add the value in MYVar?
DAO and key number.
-
- Administrator
- Posts: 78573
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DAO and key number.
The new AutoNumber value is available when you execute AddNew:
Code: Select all
rs.AddNew
MyVar = rs.ID
...
rs.Update
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4364
- Joined: 26 Apr 2010, 17:36
Re: DAO and key number.
work! buit i have changed rs.ID in rs!ID.HansV wrote:The new AutoNumber value is available when you execute AddNew:
Code: Select all
rs.AddNew MyVar = rs.ID ... rs.Update
with rs.ID, i have error
-
- Administrator
- Posts: 78573
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands