Access macro control program-1. 5. A macro instance-verify the password

Source: Internet
Author: User


5. A macro instance -- verify the password
In this instance, a macro group containing conditions is created to verify the password. If the password is correct, close the identity check window and open another form; if the password is incorrect, a message box is displayed asking you to enter the password again.

Create a form, add a text box, and name it "administrator password" to receive the password entered by the user. Create a confirmation button and a Cancel button.

Create a macro group for the button. The macro design view is shown in.
Ellipsis (…) in the "condition" column (...), This indicates that these operations can be performed consecutively when the condition is true.

This is the result of the form operation.
When the entered password is incorrect, click OK to display a message box "Incorrect password.
In this example, the administrator password is defined as "system", which is not feasible in actual applications, because the password will be changed at any time as needed. To implement this function, you can first create a user table, which stores the user password, and use the user input password in the macro to compare it with the password in the User table. If you want to change the password, you can change the table 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.