Access uses an instance of a macro in the macro control program to verify the password

Source: Internet
Author: User

In this instance, you will create a macro group that will contain the criteria to verify the password, and if the password is correct, close the Identity Check window first, and then open another form; If the password is incorrect, the message box will require the password to be entered again.

Create a form, add a text box, and name it "Admin password" to receive the password that the user entered. Then create a OK button and a Cancel button.

Create a macro group for the button, and the macro Design view is as shown above.

The ellipsis (...) in the condition bar, which indicates that you can perform these operations sequentially when the condition is true.

This is the effect of the form running.

When the password you entered is incorrect, clicking the OK button will show a message box with an incorrect password.

In this example, the admin password is defined as "system", which is not feasible in practical applications because the password is changed at any time because of the need. To achieve this, you can build a user table that holds the user's password and compares it with the password entered by the user in the macro and the password in the user's table. If you want to change the password, you can change the table's data.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.