I have a login form , i want to limit privileges of the user based on their type (e.g ; admin, encoder) wherein when the admin login, the mdi form will load and all the control buttons are accesible for him, while when the encoder login , only one button is enabled for him.
this is what i've gone so far
If cmbposition.Text = "Administrative Head" Or cmbposition.Text = "HR Head" Or cmbposition.Text = "Team Leader" Or cmbposition.Text = "General Manager" Or cmbposition.Text = "Operation Head" Or cmbposition.Text = "Asst. Operation Head" Or cmbposition.Text = "Programmer" Then
MDIEBatch.Show()
Me.Hide()
txtuser.Clear()
txtpass.Clear()
ElseIf cmbposition.Text = "Entry" Or cmbposition.Text = "Verifier" Or cmbposition.Text = "MD Clipper" Or cmbposition.Text = "Encoder" Then
MDIEBatch.Show()
MDIEBatch.btnAddnewuser.Enabled = False
MDIEBatch.btnBatchForm.Enabled = False
MDIEBatch.btnhistory.Enabled = False
MDIEBatch.btnNewjob.Enabled = False
MDIEBatch.btnlogs.Enabled = False
MDIEBatch.btnJobStat.Enabled = False
MDIEBatch.btnMasterlist.Enabled = False
Me.Hide()
txtuser.Clear()
txtpass.Clear()
Else
MsgBox("Either Username/Password is Incorrect", MsgBoxStyle.Exclamation, "Incorrect User!")
txtuser.Clear()
txtpass.Clear()
End If
unfortunately, it didn't work. all the controls are still enabled regardless of who logged in in the system.
can somebody help and tell me where i am wrong and suggest what should i do?
any help will be highly appreciated. thanks in advance ^_^