So we're having a log-in form in which the program must detect what position the user is assigned to. (selecting position is done during sign-up, so position of the user is saved into the database already). Supposedly, there is a separate form for every position.
Dim username As String = txtUser.Text
Dim password As String = txtPass.Text
//check if username and password exist
checklogin(username, password)
If RS.EOF Then
MessageBox.Show("Mismatch Entry", "confirmation Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
txtUser.Clear()
txtUser.Focus()
Else
Me.Hide()
//problem starts here
checkposition()
If (position == "Officer")
OfficerForm.Show()
Elseif (position == "Head")
HeadForm.Show()
Elseif (position == "Admin")
AdminForm.Show()
Else
// dialog box
End If
End Sub
The method for checkposition:
Public Sub checkpositon(ByVal username As String, ByVal positon As String)
RS = CN.Execute("SELECT position FROM admin WHERE uName = '" & username & "' ")
End Sub
I know there's still something missing in the code. and I know what's wrong with it. How will the position in the database be retrieved into the log-in form? PLEASE HELP :( Thank you!