My program fail to generate the auto ID on my text can help me.
Private Sub getNextNumber()
If Not app.State = ConnectionState.Open Then
'open connection
app.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("select top 1 ID from ADMIN ORDER BY ID desc;", app)
Dim dt As New DataTable
'fill data to datatable
da.Fill(dt)
app.Close()
If dt.Rows.Count > 0 Then
txtID.Text = (Val(dt.Rows(0)(0)) + 1).ToString.PadLeft(5, "A")
Else
txtID.Text = "1".PadLeft(5, "A")
End If
End Sub