visual basic coding in access 2007
HI!
I am a student and I am preparing my BECHALOR thesis. I am constructing and manipulating a library database. My problem is this:
I've a table named tblUsers that have this fields:
UserName—–Text
Password——Text
Access——–Number(1 for student and o for admin)
ID—————-Autonumber
I've also created a login form witch contain a combo box named Combo21 that displays all the UserNames , a textbox named Password and a button named Login.
That I want my code to do is to control
1- if the username is entered
2- if the password is entered
3- to control if the password entered match with the username and only if this condition is true to open Form Student_Menu if the [Access].[tblUsers]=1 or open Form Admin_Menu if the [Access].[tblUsers]=0.
My problem is with the VBA syntax or smth else because I have a clear idea of what to do but I can't express it in VBA code.
Hope that my explanation was understandable!! I would appreciate any replies.Thanks in avance!!
Comment on Micromax's post
Should be lblPromp.Caption
I couldn't find a edit answer button.
I noticed I made a typo. Sorry.
Rob
Comment on Micromax's post
You may have to add a line of code after the DLookup function = 1
DoCmd.OpenForm "frmName" Or DLookup function =2
DoCmd.OpenForm "OtherfrmName"
I'm not sure, Maybe Scott can solve this.