I TRY TO MAKE CODE COUNTER WITH CODE MR/IR/001 IN MY APPLICATION USING VISUAL BASIC 2008, BUT WHEN THE CODE GET MR/IR/999 IT`S STUCK AND NOT INCREASING, I WANT TO MAKE THE CODE INCREASE TO :
MR/IR/1000
MR/IR/1001
MR/IR/1002
MORE AND MORE ...
FOR DATABASE I`M USING MS ACCESS 2007
PLZ HELP ME...
------------------------------------------------------------------------------------
Dim strTemp As String = ""
Dim strValue As String = ""
Dim sql As String
sql = "SELECT * FROM DETAILPERIKSA ORDER BY IDPERIKSA DESC"
cmd = New OleDbCommand(sql, Conn)
dtReader = cmd.ExecuteReader
If dtReader.Read Then
strTemp = Mid(dtReader.Item("IDPERIKSA"), 7, 4)
Else
TxtDETAILTRANS.Text = "MR/IR/001"
Exit Sub
End If
msgBox(strTemp)
strValue = Val(strTemp) + 1
TxtDETAILTRANS.Text = "MR/IR/" & Mid("000", 1, 3 - strValue.Length) & strValue