Sub AutoGenearteMember_id()
Dim sqlTmp As String = ""
Dim comTmp As OleDbCommand = New OleDbCommand
Dim drTmp As OleDbDataReader
Dim tmpMember_id As Integer = 0
sqlTmp = "SELECT TOP 1 IDAdmin FROM Admin ORDER BY IDAdmin DESC"
Try
With comTmp
.CommandType = CommandType.Text
.CommandText = sqlTmp
.Connection = Connection
drTmp = .ExecuteReader
drTmp.Read()
tmpMember_id = CInt(drTmp.Item("Member_id"))
drTmp.Close()
tmpMember_id = tmpMember_id + 1
txtID.Text = tmpMember_id.ToString("0000")
End With
Catch ex As Exception
txtID.Text = "0001"
End Try