Quick question though
I did everything as directed but when I put in the code:
Dim varunitnumber as integer
If me.txtpassword = dlookup("[Password]","Users","[UserID]='"&me.txtusername & "'" then
VarUnitNumber=dlookup("[Unit]","Users","[UserID]='"&me.txtusername & "'"
Docmd.close acform
docmd.openform hhform ,,,"[Unit]=" & varunitnumber
Else
msgbox "Invalid Username/Password"
Endif
Nothing really happened. I can type anything into the login form and it goes directly to the other form. What am I doing wrong?
Btw the form I'm trying to password protect in the example is hhform thus why that is in the code.
I did everything as directed but when I put in the code:
Dim varunitnumber as integer
If me.txtpassword = dlookup("[Password]","Users","[UserID]='"&me.txtusername & "'" then
VarUnitNumber=dlookup("[Unit]","Users","[UserID]='"&me.txtusername & "'"
Docmd.close acform
docmd.openform hhform ,,,"[Unit]=" & varunitnumber
Else
msgbox "Invalid Username/Password"
Endif
Nothing really happened. I can type anything into the login form and it goes directly to the other form. What am I doing wrong?
Btw the form I'm trying to password protect in the example is hhform thus why that is in the code.