G
Guest
Hi all
If you use DAO to create a new record the code looks something like this:
Dim DatabaseName As DAO.Database
Set DatabaseName As CurrentDb
Dim TableName As DAO.Recordset
Set TableName = DatabaseName.OpenRecordset(“Name Of Tableâ€)
With TableName
..AddNew
![Field 1] = Value1
![Field 2] = Value2
..Update
..Close
End With
If the table has an autonumber primary key, is there a quick way to get this
new number? (I.E. to find out what it is, and store it in a variable or
something?)
Thanks
David
If you use DAO to create a new record the code looks something like this:
Dim DatabaseName As DAO.Database
Set DatabaseName As CurrentDb
Dim TableName As DAO.Recordset
Set TableName = DatabaseName.OpenRecordset(“Name Of Tableâ€)
With TableName
..AddNew
![Field 1] = Value1
![Field 2] = Value2
..Update
..Close
End With
If the table has an autonumber primary key, is there a quick way to get this
new number? (I.E. to find out what it is, and store it in a variable or
something?)
Thanks
David