A simple description of the calculation method of the wage system of dynamic formula

Source: Internet
Author: User
Dynamic


The calculation method of the wage system with a simple description of the dynamic formula





 





question:





a simple description of the calculation of the wage system of Access dynamic formula


 





Answer:








the simplest dynamic formula system is shown in the following ways


If you use the actual, you can also group the formula, the staff divided into different groups of different departments of personnel and so on.


of course, it also involves the content of the form interface programming, or it can be resolved by changing the control's data source in code.


Private Sub updateformula ()


' Tbl_pay table is used to store payroll information, there are many similar FLD1 FLD2 FLD3 ... This type of currency field


' Tbl_formula table is used to store calculation formulas


' Tbl_formula table has several fields

The
' FieldName field is used to hold the name of the field in the Tbl_pay

The
' formula field is used to hold the formula, similar to the FLD1*FLD2+FLD3 formula, not to precede the "=" Symbol

The
' canprint field is used to identify whether printing is allowed


    


Dim strSQL as String


Dim Rs as New ADODB. Recordset


Dim Conn as New ADODB. Connection


Set Conn = currentproject.connection


rs.open "SELECT * from Tbl_formula where canprint=1 order by ID", Conn, adOpenDynamic, adLockBatchOptimistic


do Until rs.eof


If IsNull (Rs ("formula") = False Then


conn.execute "Update Tbl_pay Set" & RS ("FieldName") & "=" & RS ("formula")


End If


Rs.movenext


Loop


Rs.close


Set Rs = Nothing


End Sub





 


http://www.access911.net Webmaster Collection





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.