I have some code that creates a new recordset in a table with an autonumber field. It then updates the database with the changes from the dataset. I then try to retrieve that new autonumbered field from the dataset, but I get a 0.
How can I get the autogenerated number?
Here is how I am trying now. refreshDb uses a dataAdapter to update the datasource with the Dataset's changes.
How can I get the autogenerated number?
Here is how I am trying now. refreshDb uses a dataAdapter to update the datasource with the Dataset's changes.
Code:
Me.DsGlobal1.Tables("SubjectData").Rows.Add(newRow)
Me.refreshDb()
idxNum = Me.DsGlobal1.Tables("SubjectData").Rows.Count - 1
newRec = Me.DsGlobal1.Tables("SubjectData").Rows(idxNum).Item("recNum")