Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I match form data to table data?

Status
Not open for further replies.

ringo9

Technical User
Sep 9, 2002
11
US
I am trying to password protect my database using a user table to hold individual names and passwords. I would like to be able to verify the password that the user enters on the login form to what is in table(filtered query) then if it matches, open the main form, and if it doesn't match, show a message box.

I am trying to do this in a macro using the condition column, but I get the error "You tried to run a visual basic procedure to set a property or method for an object. The component doesn't makethe property or method available for automation operations."

Does this mean I can not use a macro group to accomplish what I want?
 
You could use a Dlookup or DCount formula to see if the password and login match.

E.g. DCount("[Login]","tblLoginPswds","[LoginID]=Forms![frmEnterPassword].txtLoginID AND [Password]=Forms!![frmEnterPassword].txtPassword")=1

as the condition would activate the action where 1 record exists with the same LoginID and Password as on the table.

Don't forget to use a password input mask on the popup form.

There is a lot of info on security on this site and it may be worthwhile looking into using the standard Access user-level security rather than setting up your own.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top