What's wrong with this code?
objRS.Open "InvLists", objConn, adOpenStatic, adLockOptimistic, adCmdTable
With objRS
.AddNew
.Fields("Name" = strName
.Fields("DateAdded" = Now
.Update
End With
iListID = objRS("ListID"
ListID is an autoNumer field in Access 2002, but it ends up being blank. If I .Requery it comes out to the first record in the table. I've seen a way to do this somewhere in the back of mind. I'm pretty sure you don't have to go back out to the database with another SELECT statement.
Any help appreciated,
Jeremy Lowery
objRS.Open "InvLists", objConn, adOpenStatic, adLockOptimistic, adCmdTable
With objRS
.AddNew
.Fields("Name" = strName
.Fields("DateAdded" = Now
.Update
End With
iListID = objRS("ListID"
ListID is an autoNumer field in Access 2002, but it ends up being blank. If I .Requery it comes out to the first record in the table. I've seen a way to do this somewhere in the back of mind. I'm pretty sure you don't have to go back out to the database with another SELECT statement.
Any help appreciated,
Jeremy Lowery