I am trying to read the last row with a value in the Number column and then increase it by one. For some reason the code below is reading the second row in the table not the last? Any ideas why?
Dim dvProjectName As DataView = DirectCast(AccessDataSource1.Select(DataSourceSelectArguments.Empty), DataView)
Dim strProjectName As String = DirectCast(dvProjectName.Table.Rows(0)("Number"), Integer)
Autonumber fields are handled by the MS Jet database engine directly. Attempting to change the value yourself will usually result in an error. If you want to manipulate the values yourself – change the field to a number field and use VBA code to change the number. Else, prepare to be disappointed as Jet won’t let you change the numbers.