Multiple DLookup Criteria

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Multiple DLookup Criteria

Post by burrina »

strAdminPWord = InputBox("Password required to proceed.", "Enter Editing Password")

tblspecialaccess
specialid
username
pswd
frmname

Need a dlookup statement to get the value in the above fields! WHERE the pswd = strAdminPWord for that username

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Multiple DLookup Criteria

Post by HansV »

For example to retrieve specialid:

DLookup("specialid", "tblspecialaccess", "username='" & strUsername & "' AND pswd='" & strAdminPWord & "'")

strUsername is a variable containing the username you want to get the information for.
Best wishes,
Hans

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Re: Multiple DLookup Criteria

Post by burrina »

Thank You Hans!

User avatar
StuartR
Administrator
Posts: 12577
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Multiple DLookup Criteria

Post by StuartR »

Creating your own code to manage passwords is ALWAYS going to lead to security holes. If this password is just to prevent mistakes then that might be fine, but if you are protecting sensitive personal or business data then please use a secure password implementation from a reliable source.
StuartR


User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Re: Multiple DLookup Criteria

Post by burrina »

This process is just for the right to be able to edit a certain fields value. It is separate from my normal security protocol.
Thanks