Excuse my previous hasty post, always bsy.
O.K. I reviewed you code from above and it needs a LOT of clean up.
First whenever reffering to a control on a form you are currently in then you should always refer to it by using me!
Such as: Me!txtPassword.SetFocus
That will save you a lot of headaches.
Next use the following:
pass = Me!txtPassword
instead of
pass = Me!txtPassword.text
That will give your variable the actual password and not just the mask.
Next problem, you have the following:
- Set dbs = CurrentDb
-
-
dbs.QueryDefs.Delete ("Login")
-
Set qdf = dbs.CreateQueryDef("Login", strSQL)
-
dbs.Execute ("Login")
-
dbs.QueryDefs.Delete ("Login")
change it to read
- Set dbs = CurrentDb
-
Set qdf = dbs.CreateQueryDef("Login", strSQL)
Make sure the login query is deleted before you run this and you should be fine.
Tried and tested good luck.