database - field[counterx3 - Id(text)Primary Key]
my code works really well before but when i changes and add codes in the others forms i got error in updating the value in my database, here's my code for update
sql = "update counterx3 set ID='" & Val(acsdr!ID) + 1 & "'"
Dim ccmd = New OleDb.OleDbCommand(sql, con)
ccmd.ExecuteNonQuery()
ccmd.Dispose
and here's the other one
Public Sub ordernumber()
sql = "select * from counterx3"
Dim cmd = New OleDb.OleDbCommand(sql, con)
acsdr = cmd.ExecuteReader()
If acsdr.Read Then
lblordernum.Text = "ORDER NUMBER: " & acsdr!ID
End If
Me.Refresh()
End Sub
my error is in the update, it says "No data exists for the row/column."
Please help, i'm working on this error since last night :( , but i really can't figure out what the reason of the error