Simple narrative method of salary system of dynamic formula

zhaozj2021-02-16  64

Simple narrative method of salary system of dynamic formula

problem:

Simple narrative method of salary system of ACCESS dynamic formula

Reply:

The following method shows the simplest dynamic formula system. Of course, it also involves the content of the form interface programming, or can be solved by using the code to change the data source of the control.

Private Sub Updateformula () 'TBL_PAY Table is used to store salary information, there are a lot of fld1 FLD2 FLD3 ... such a currency field' TBL_Formula meter for storing the calculation formula 'TBL_FORMULA table with several fields' fieldName fields for storing TBL_PAY The field name "Formula field is used to store formulas, similar to FLD1 * FLD2 FLD3, do not put" = "symbol 'canprint field to identify if it is allowed to print DIM STRS STRING DIM RS AS NEW AdoDDDSet 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") & "=" & = ") end if rs.movenext loop = Nothingend Sub

http://www.access911.net webmaster collection

转载请注明原文地址:https://www.9cbs.com/read-24511.html

New Post(0)