database - MS Access 2007 login form -
i working database in access, , creating login form restrict data password:
- anyone has password can access database
- if wrong password entered no database access granted
- after 3 unsuccessful logins, automatically close database.
i tried code , don't know why doesn't work. part of code this:
private sub btn_login_click() username.setfocus if username = "admin" , password = "test" msgbox "password correct", vbinformation, "cd shop" msgbox "welcome", vbinformation, "cdshop" docmd.close docmd.openform "switchboard" elseif username = "menager" , password = "menager" msgbox "password correct", vbinformation, "cd shop" msgbox "password correct", vbinformation, "cd shop" msgbox "welcome", vbinformation, "cd shop" docmd.close docmd.openform "switchboard" else msgbox "please write username , password correct" end if end sub docmd.close docmd.openform "switchboard" else msgbox "please write username , password correct" end if end sub
Comments
Post a Comment