ADO programming need
I try to add newrecord that have a autonumbering field so when I do update I can't take the value of autonumbering fields
so how can i know the value of autonumbering of newrecord without closing the recordset
thanks
Web Development
I try to add newrecord that have a autonumbering field so when I do update I can't take the value of autonumbering fields
so how can i know the value of autonumbering of newrecord without closing the recordset
thanks
by john_wills
Dim AutoCatcher As String
Dim AutoHolder As DAO.Recordset
AutoCatcher = "Select max(autothing) as Indifferent from TableWithAutonumbering;"
Set AutoHolder = CurrentDb().OpenRecordset(AutoCatcher)
AutoHolder.MoveFirst
Me.AutoThing = AutoHolder.Fields(0)
This means using a new recordset, which may be possible in your circumstances. But perhaps you can do something with the recordset you already have.
by khalid
if I write this code
-------
adoprimaryRS.addnew
adoprimaryRS.fields("Name")="Jon"
adoprimaryRS.update
-------
so if I have a autonumbering Fields (ID) in that same table
and after updating I want that value it saved in the (ID) field
--
I hope you understand me
by john_wills
by khalid
by khalid
This discussion is closed to new replies.
Sort by Trending