This is for my vb.net 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 ...help 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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.