Data room charging system-Use of object sets

Source: Internet
Author: User

Because the data room charging system has many forms and controls, it sometimes needs to operate on multiple objects. In this case, the object set will save a lotCodeQuantity. Code is time, and time is life. The more streamlined, the better the efficiency.

1, Form set

Implement a function in the charging system:When a form is opened, other opened forms must be minimized. The implementation is as follows:

Private sub form_activate () 'minimizes dim frmcurr as form for each frmcurr in forms if frmcurr. name <> "frmmain" and frmcurr. name <> "frmmainshow" and frmcurr. name <> me. name then frmcurr. windowstate = 1 end if next frmcurrend sub

2. Control Set

For example, all text boxes except the card number are cleared: (two methods)

Method 1:

'Aside from the card number, clear all text boxes dim mycontrol as control for each mycontrol in me. controls if typeof mycontrol is textbox then if mycontrol. name <> "txtcardno" then mycontrol. TEXT = "" end if next

Method 2:

 
Dim mycontrol as Controlfor each mycontrol in me. controls if typename (mycontrol) = "textbox" then mycontrol. Text = "" End ifnext



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.