This is for my code when new record inserted patient id is checking for database value and incremented by next value ... code working fine to incremented only for 1 to 10 ....if record exceeds 10 value cannot be incremented me folks ...

Dim oleDBDR As OleDbDataReader
Dim oleDBCommand As New OleDbCommand
With oleDBCommand
.Connection = conn
.CommandText = "SELECT * FROM tblPatient ORDER BY PatientID DESC"
End With
oleDBDR = oleDBCommand.ExecuteReader
If oleDBDR.Read Then
txtPatientID.Text = Val(oleDBDR.Item(0)) + 1
End If

You haven't included the area of code where the error is occurring. How is tblPatient defined? What kind of backend are you using? There is apparently some restriction or range limits defined somewhere you need to find.