0

how to show different forms on different identification?
sory friend i'm new in vb.net. working on School Management System project. and dont now how to show different forms on different identification.
i have no any idea releated to this. need your help!
i have 3 main forms for 3 different actors (student's form "frm_student", teacher's form "frm_teacher", and Admin form "frm_admin).
and a Login form that have textbox names (id, name, password, category)
i want to work on "Category" like as (admin for frm_admin, teacher for frm_teacher, student for frm_student)
plz help me by sharing any piece of code in vb.net.
idea is this. if user write "admin" in txt_category, Frm_admin should apair.
if user write "teacher" in txt_category, Frm_teacher should apair.
if user write "student" in txt_category, Frm_student should apair.
(admin, teacher, student) these 3 actors are aleready saved in login database tabel.

3
Contributors
2
Replies
9
Views
2 Years
Discussion Span
Last Post by Mr.M
0

When the user logs in return their category then:

SELECT category WHERE name = ?name AND password = ?password;

Then a simple IF statement decides what form to send them to based on the returned category and redirects as needed.
As an added advantage you don't need the user to remember what they need to type into that textbox to get to the right form.

0

As hericles have said. You can do it like this.

 If txt_category.Text = "Admin" Then
 Me.Hide()
 Frm_admin.Show() ' Or you can use .Visible = True()
 Else
 If txt_category.Text = "Student" Then
 Me.Hide()
 Frm_Student.Show()
 Else
 If txt_category.Text = "Teacher" Then
 Me.Hide()
 Frm_Teacher.Show()
 End If
 End If
 End If

Hope this helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.