F_YangLaoJiaoFei.frm
上传用户:xiao_xia32
上传日期:2022-07-21
资源大小:1174k
文件大小:25k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  3. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  4. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  6. Begin VB.Form F_YangLaoJiaoFei 
  7.    BorderStyle     =   3  'Fixed Dialog
  8.    Caption         =   "养老保险缴费情况表"
  9.    ClientHeight    =   6360
  10.    ClientLeft      =   1095
  11.    ClientTop       =   330
  12.    ClientWidth     =   10050
  13.    ControlBox      =   0   'False
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form1"
  16.    LockControls    =   -1  'True
  17.    MaxButton       =   0   'False
  18.    MinButton       =   0   'False
  19.    Moveable        =   0   'False
  20.    ScaleHeight     =   6360
  21.    ScaleWidth      =   10050
  22.    StartUpPosition =   2  '屏幕中心
  23.    Begin VB.Frame Frame1 
  24.       Height          =   6015
  25.       Left            =   240
  26.       TabIndex        =   17
  27.       Top             =   120
  28.       Width           =   9615
  29.       Begin TabDlg.SSTab SSTab1 
  30.          Height          =   5415
  31.          Left            =   240
  32.          TabIndex        =   18
  33.          Top             =   360
  34.          Width           =   9135
  35.          _ExtentX        =   16113
  36.          _ExtentY        =   9551
  37.          _Version        =   393216
  38.          Tabs            =   2
  39.          TabHeight       =   520
  40.          TabCaption(0)   =   "编        辑"
  41.          TabPicture(0)   =   "F_YangLaoJiaoFei.frx":0000
  42.          Tab(0).ControlEnabled=   -1  'True
  43.          Tab(0).Control(0)=   "Frame2"
  44.          Tab(0).Control(0).Enabled=   0   'False
  45.          Tab(0).Control(1)=   "Picture1"
  46.          Tab(0).Control(1).Enabled=   0   'False
  47.          Tab(0).ControlCount=   2
  48.          TabCaption(1)   =   "列        表"
  49.          TabPicture(1)   =   "F_YangLaoJiaoFei.frx":001C
  50.          Tab(1).ControlEnabled=   0   'False
  51.          Tab(1).Control(0)=   "Frame3"
  52.          Tab(1).ControlCount=   1
  53.          Begin VB.PictureBox Picture1 
  54.             Appearance      =   0  'Flat
  55.             BorderStyle     =   0  'None
  56.             BeginProperty Font 
  57.                Name            =   "MS Sans Serif"
  58.                Size            =   8.25
  59.                Charset         =   0
  60.                Weight          =   400
  61.                Underline       =   0   'False
  62.                Italic          =   0   'False
  63.                Strikethrough   =   0   'False
  64.             EndProperty
  65.             ForeColor       =   &H80000008&
  66.             Height          =   420
  67.             Left            =   2160
  68.             ScaleHeight     =   420
  69.             ScaleWidth      =   6720
  70.             TabIndex        =   34
  71.             Top             =   4800
  72.             Width           =   6720
  73.             Begin Threed.SSCommand cmdClose 
  74.                Height          =   330
  75.                Left            =   5520
  76.                TabIndex        =   35
  77.                Top             =   0
  78.                Width           =   1095
  79.                _Version        =   65536
  80.                _ExtentX        =   1931
  81.                _ExtentY        =   573
  82.                _StockProps     =   78
  83.                Caption         =   "&Q.关闭"
  84.                Font3D          =   1
  85.             End
  86.             Begin Threed.SSCommand CmdAdd 
  87.                Height          =   330
  88.                Left            =   720
  89.                TabIndex        =   12
  90.                Top             =   0
  91.                Width           =   1095
  92.                _Version        =   65536
  93.                _ExtentX        =   1931
  94.                _ExtentY        =   573
  95.                _StockProps     =   78
  96.                Caption         =   "&A.增 加"
  97.                Font3D          =   1
  98.             End
  99.             Begin Threed.SSCommand cmdEdit 
  100.                Height          =   330
  101.                Left            =   1920
  102.                TabIndex        =   13
  103.                Top             =   0
  104.                Width           =   1095
  105.                _Version        =   65536
  106.                _ExtentX        =   1931
  107.                _ExtentY        =   573
  108.                _StockProps     =   78
  109.                Caption         =   "&E.编 辑"
  110.                Font3D          =   1
  111.             End
  112.             Begin Threed.SSCommand CmdDelete 
  113.                Height          =   330
  114.                Left            =   3120
  115.                TabIndex        =   14
  116.                Top             =   0
  117.                Width           =   1095
  118.                _Version        =   65536
  119.                _ExtentX        =   1931
  120.                _ExtentY        =   573
  121.                _StockProps     =   78
  122.                Caption         =   "&D.删 除"
  123.                Font3D          =   1
  124.             End
  125.             Begin Threed.SSCommand cmdUpdate 
  126.                Height          =   330
  127.                Left            =   4320
  128.                TabIndex        =   36
  129.                Top             =   0
  130.                Width           =   1095
  131.                _Version        =   65536
  132.                _ExtentX        =   1931
  133.                _ExtentY        =   573
  134.                _StockProps     =   78
  135.                Caption         =   "&Y.保存"
  136.                Font3D          =   1
  137.             End
  138.             Begin Threed.SSCommand cmdRefresh 
  139.                Height          =   330
  140.                Left            =   4320
  141.                TabIndex        =   15
  142.                Top             =   0
  143.                Width           =   1095
  144.                _Version        =   65536
  145.                _ExtentX        =   1931
  146.                _ExtentY        =   573
  147.                _StockProps     =   78
  148.                Caption         =   "&R.刷 新"
  149.                Font3D          =   1
  150.             End
  151.             Begin Threed.SSCommand cmdCancel 
  152.                Height          =   330
  153.                Left            =   5520
  154.                TabIndex        =   16
  155.                Top             =   0
  156.                Width           =   1095
  157.                _Version        =   65536
  158.                _ExtentX        =   1931
  159.                _ExtentY        =   573
  160.                _StockProps     =   78
  161.                Caption         =   "&C.取 消"
  162.                Font3D          =   1
  163.             End
  164.          End
  165.          Begin VB.Frame Frame3 
  166.             Height          =   4695
  167.             Left            =   -74760
  168.             TabIndex        =   32
  169.             Top             =   480
  170.             Width           =   8655
  171.             Begin MSDataGridLib.DataGrid DataGrid1 
  172.                Height          =   4215
  173.                Left            =   240
  174.                TabIndex        =   33
  175.                Top             =   240
  176.                Width           =   8175
  177.                _ExtentX        =   14420
  178.                _ExtentY        =   7435
  179.                _Version        =   393216
  180.                AllowUpdate     =   0   'False
  181.                HeadLines       =   1
  182.                RowHeight       =   14
  183.                BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  184.                   Name            =   "MS Sans Serif"
  185.                   Size            =   8.25
  186.                   Charset         =   0
  187.                   Weight          =   400
  188.                   Underline       =   0   'False
  189.                   Italic          =   0   'False
  190.                   Strikethrough   =   0   'False
  191.                EndProperty
  192.                BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  193.                   Name            =   "宋体"
  194.                   Size            =   9
  195.                   Charset         =   134
  196.                   Weight          =   400
  197.                   Underline       =   0   'False
  198.                   Italic          =   0   'False
  199.                   Strikethrough   =   0   'False
  200.                EndProperty
  201.                ColumnCount     =   2
  202.                BeginProperty Column00 
  203.                   DataField       =   ""
  204.                   Caption         =   ""
  205.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  206.                      Type            =   0
  207.                      Format          =   ""
  208.                      HaveTrueFalseNull=   0
  209.                      FirstDayOfWeek  =   0
  210.                      FirstWeekOfYear =   0
  211.                      LCID            =   2052
  212.                      SubFormatType   =   0
  213.                   EndProperty
  214.                EndProperty
  215.                BeginProperty Column01 
  216.                   DataField       =   ""
  217.                   Caption         =   ""
  218.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  219.                      Type            =   0
  220.                      Format          =   ""
  221.                      HaveTrueFalseNull=   0
  222.                      FirstDayOfWeek  =   0
  223.                      FirstWeekOfYear =   0
  224.                      LCID            =   2052
  225.                      SubFormatType   =   0
  226.                   EndProperty
  227.                EndProperty
  228.                SplitCount      =   1
  229.                BeginProperty Split0 
  230.                   BeginProperty Column00 
  231.                   EndProperty
  232.                   BeginProperty Column01 
  233.                   EndProperty
  234.                EndProperty
  235.             End
  236.          End
  237.          Begin VB.Frame Frame2 
  238.             Height          =   4215
  239.             Left            =   240
  240.             TabIndex        =   19
  241.             Top             =   480
  242.             Width           =   8655
  243.             Begin MSComCtl2.DTPicker DTPicker2 
  244.                DataField       =   "缴费结束时间"
  245.                Height          =   300
  246.                Left            =   6120
  247.                TabIndex        =   5
  248.                Top             =   1680
  249.                Width           =   1935
  250.                _ExtentX        =   3413
  251.                _ExtentY        =   529
  252.                _Version        =   393216
  253.                CheckBox        =   -1  'True
  254.                DateIsNull      =   -1  'True
  255.                Format          =   69664769
  256.                CurrentDate     =   36191
  257.             End
  258.             Begin MSComCtl2.DTPicker DTPicker1 
  259.                DataField       =   "缴费开始时间"
  260.                Height          =   300
  261.                Left            =   1680
  262.                TabIndex        =   4
  263.                Top             =   1680
  264.                Width           =   1935
  265.                _ExtentX        =   3413
  266.                _ExtentY        =   529
  267.                _Version        =   393216
  268.                CheckBox        =   -1  'True
  269.                DateIsNull      =   -1  'True
  270.                Format          =   69664769
  271.                CurrentDate     =   36191
  272.             End
  273.             Begin VB.TextBox txtFields 
  274.                Appearance      =   0  'Flat
  275.                DataField       =   "个人缴纳"
  276.                Enabled         =   0   'False
  277.                Height          =   285
  278.                Index           =   12
  279.                Left            =   1680
  280.                TabIndex        =   10
  281.                Top             =   3480
  282.                Width           =   1935
  283.             End
  284.             Begin VB.TextBox txtFields 
  285.                Appearance      =   0  'Flat
  286.                DataField       =   "划入帐户"
  287.                Enabled         =   0   'False
  288.                Height          =   285
  289.                Index           =   11
  290.                Left            =   6120
  291.                TabIndex        =   9
  292.                Top             =   2880
  293.                Width           =   1935
  294.             End
  295.             Begin VB.TextBox txtFields 
  296.                Appearance      =   0  'Flat
  297.                DataField       =   "个人帐户金额小计"
  298.                Enabled         =   0   'False
  299.                Height          =   285
  300.                Index           =   10
  301.                Left            =   6120
  302.                TabIndex        =   11
  303.                Top             =   3480
  304.                Width           =   1935
  305.             End
  306.             Begin VB.TextBox txtFields 
  307.                Appearance      =   0  'Flat
  308.                DataField       =   "统筹基金"
  309.                Enabled         =   0   'False
  310.                Height          =   285
  311.                Index           =   9
  312.                Left            =   1680
  313.                TabIndex        =   8
  314.                Top             =   2880
  315.                Width           =   1935
  316.             End
  317.             Begin VB.TextBox txtFields 
  318.                Appearance      =   0  'Flat
  319.                DataField       =   "职工月缴费基数"
  320.                Height          =   285
  321.                Index           =   8
  322.                Left            =   6120
  323.                TabIndex        =   7
  324.                Top             =   2280
  325.                Width           =   1935
  326.             End
  327.             Begin VB.TextBox txtFields 
  328.                Appearance      =   0  'Flat
  329.                DataField       =   "月数"
  330.                Height          =   285
  331.                Index           =   7
  332.                Left            =   1680
  333.                TabIndex        =   6
  334.                Top             =   2280
  335.                Width           =   1935
  336.             End
  337.             Begin VB.TextBox txtFields 
  338.                Appearance      =   0  'Flat
  339.                DataField       =   "姓名"
  340.                Height          =   285
  341.                Index           =   3
  342.                Left            =   6120
  343.                TabIndex        =   1
  344.                Top             =   480
  345.                Width           =   1935
  346.             End
  347.             Begin VB.TextBox txtFields 
  348.                Appearance      =   0  'Flat
  349.                DataField       =   "员工号"
  350.                Height          =   285
  351.                Index           =   2
  352.                Left            =   1680
  353.                TabIndex        =   0
  354.                Top             =   480
  355.                Width           =   1935
  356.             End
  357.             Begin VB.TextBox txtFields 
  358.                Appearance      =   0  'Flat
  359.                DataField       =   "社会保障号码"
  360.                Height          =   285
  361.                Index           =   1
  362.                Left            =   6120
  363.                TabIndex        =   3
  364.                Top             =   1080
  365.                Width           =   1935
  366.             End
  367.             Begin VB.TextBox txtFields 
  368.                Appearance      =   0  'Flat
  369.                DataField       =   "电脑序号"
  370.                Height          =   285
  371.                Index           =   0
  372.                Left            =   1680
  373.                TabIndex        =   2
  374.                Top             =   1080
  375.                Width           =   1935
  376.             End
  377.             Begin VB.Label lblLabels 
  378.                Caption         =   "个人缴纳"
  379.                Height          =   255
  380.                Index           =   12
  381.                Left            =   360
  382.                TabIndex        =   31
  383.                Top             =   3480
  384.                Width           =   975
  385.             End
  386.             Begin VB.Label lblLabels 
  387.                Caption         =   "划入帐户"
  388.                Height          =   255
  389.                Index           =   11
  390.                Left            =   4320
  391.                TabIndex        =   30
  392.                Top             =   2880
  393.                Width           =   975
  394.             End
  395.             Begin VB.Label lblLabels 
  396.                Caption         =   "个人帐户金额小计"
  397.                Height          =   255
  398.                Index           =   10
  399.                Left            =   4320
  400.                TabIndex        =   29
  401.                Top             =   3480
  402.                Width           =   1575
  403.             End
  404.             Begin VB.Label lblLabels 
  405.                Caption         =   "统筹基金"
  406.                Height          =   255
  407.                Index           =   9
  408.                Left            =   360
  409.                TabIndex        =   28
  410.                Top             =   2880
  411.                Width           =   1095
  412.             End
  413.             Begin VB.Label lblLabels 
  414.                Caption         =   "职工月缴费基数"
  415.                Height          =   255
  416.                Index           =   8
  417.                Left            =   4320
  418.                TabIndex        =   27
  419.                Top             =   2280
  420.                Width           =   1335
  421.             End
  422.             Begin VB.Label lblLabels 
  423.                Caption         =   "月   数"
  424.                Height          =   255
  425.                Index           =   7
  426.                Left            =   360
  427.                TabIndex        =   26
  428.                Top             =   2280
  429.                Width           =   1095
  430.             End
  431.             Begin VB.Label lblLabels 
  432.                Caption         =   "缴费结束时间"
  433.                Height          =   255
  434.                Index           =   6
  435.                Left            =   4320
  436.                TabIndex        =   25
  437.                Top             =   1680
  438.                Width           =   1215
  439.             End
  440.             Begin VB.Label lblLabels 
  441.                Caption         =   "缴费开始时间"
  442.                Height          =   255
  443.                Index           =   5
  444.                Left            =   360
  445.                TabIndex        =   24
  446.                Top             =   1680
  447.                Width           =   1215
  448.             End
  449.             Begin VB.Label lblLabels 
  450.                Caption         =   "姓   名"
  451.                Height          =   255
  452.                Index           =   3
  453.                Left            =   4320
  454.                TabIndex        =   23
  455.                Top             =   480
  456.                Width           =   1095
  457.             End
  458.             Begin VB.Label lblLabels 
  459.                Caption         =   "员工号"
  460.                Height          =   255
  461.                Index           =   2
  462.                Left            =   360
  463.                TabIndex        =   22
  464.                Top             =   480
  465.                Width           =   1095
  466.             End
  467.             Begin VB.Label lblLabels 
  468.                Caption         =   "社会保障号码"
  469.                Height          =   255
  470.                Index           =   1
  471.                Left            =   4320
  472.                TabIndex        =   21
  473.                Top             =   1080
  474.                Width           =   1215
  475.             End
  476.             Begin VB.Label lblLabels 
  477.                Caption         =   "电脑序号"
  478.                Height          =   255
  479.                Index           =   0
  480.                Left            =   360
  481.                TabIndex        =   20
  482.                Top             =   1080
  483.                Width           =   1095
  484.             End
  485.          End
  486.       End
  487.    End
  488. End
  489. Attribute VB_Name = "F_YangLaoJiaoFei"
  490. Attribute VB_GlobalNameSpace = False
  491. Attribute VB_Creatable = False
  492. Attribute VB_PredeclaredId = True
  493. Attribute VB_Exposed = False
  494. Dim WithEvents adoPrimaryRS As Recordset
  495. Attribute adoPrimaryRS.VB_VarHelpID = -1
  496. Dim mvBookMark As Variant
  497. Dim mbEditFlag As Boolean
  498. Dim mbAddNewFlag As Boolean
  499. '统筹基金比例
  500.  Dim tcjj  As Double
  501.  '划入帐户比例
  502.  Dim hrzh  As Double
  503.  '个人缴纳比例
  504.  Dim grjn  As Double
  505. Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
  506. If KeyAscii = vbKeyReturn Then
  507.     SendKeys "{TAB}"
  508. End If
  509. End Sub
  510. Private Sub DTPicker2_Change()
  511. Dim Sql3 As String
  512.  
  513.   
  514. If DTPicker2.Value <> "" Then
  515.     Sql3 = "select  distinct 统筹基金比例 ,划入帐户比例 ,个人缴纳比例 from 养老保险公司比例  where 年度 = " & Year(DTPicker2.Value)
  516.    
  517.     Set rs3 = db.Execute(Sql3)
  518.   If Not rs3.EOF Then
  519.     
  520.     If Not IsNull(rs3("统筹基金比例")) Then
  521.     tcjj = Trim(rs3("统筹基金比例")) / 100
  522.     End If
  523.     
  524.     If Not IsNull(rs3("划入帐户比例")) Then
  525.        hrzh = Trim(rs3("划入帐户比例")) / 100
  526.     End If
  527.     
  528.     If Not IsNull(rs3("个人缴纳比例")) Then
  529.        grjn = Trim(rs3("个人缴纳比例")) / 100
  530.     End If
  531.     
  532.     If IsNumeric(txtFields(7)) And IsNumeric(txtFields(8)) Then
  533.   
  534.    txtFields(9) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * tcjj
  535.    txtFields(11) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * hrzh
  536.    txtFields(12) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * grjn
  537.  
  538.    txtFields(10) = CDbl(txtFields(11)) + CDbl(txtFields(12))
  539.   End If
  540.   
  541.  
  542.    Else
  543.       MsgBox "公司比例中没有此年的记录,请输入后再进行缴费记录的填写!"
  544.    
  545.    End If
  546.  
  547. End If
  548. End Sub
  549. Private Sub DTPicker2_KeyPress(KeyAscii As Integer)
  550. If KeyAscii = vbKeyReturn Then
  551.     SendKeys "{TAB}"
  552. End If
  553. End Sub
  554. Private Sub Form_Load()
  555. On Error Resume Next
  556.     For Each TextBox In Me.Controls
  557.         TextBox.Font.Name = "宋体"
  558.         TextBox.Font.Size = 9
  559.     Next
  560.   
  561.   Set adoPrimaryRS = New Recordset
  562.   adoPrimaryRS.Open "select * from 养老保险缴费情况表", db, adOpenStatic, adLockOptimistic
  563.   Set DataGrid1.DataSource = adoPrimaryRS
  564.   
  565.   SetButtons True
  566.   
  567.   Dim oText As TextBox
  568.   'Bind the text boxes to the data provider
  569.   For Each oText In Me.txtFields
  570.     Set oText.DataSource = adoPrimaryRS
  571.   Next
  572.       Set DTPicker1.DataSource = adoPrimaryRS
  573.       Set DTPicker2.DataSource = adoPrimaryRS
  574. End Sub
  575. Private Sub Form_Unload(Cancel As Integer)
  576.   Screen.MousePointer = vbDefault
  577. End Sub
  578. Private Sub cmdAdd_Click()
  579.   On Error GoTo AddErr
  580.  With adoPrimaryRS
  581.     If Not (.BOF And .EOF) Then
  582.       mvBookMark = .Bookmark
  583.     End If
  584.     .AddNew
  585.     mbAddNewFlag = True
  586.     SetButtons False
  587.   End With
  588.   On Error GoTo 0
  589.   Exit Sub
  590. AddErr:
  591.   MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
  592.   
  593. End Sub
  594. Private Sub cmdDelete_Click()
  595.   On Error GoTo DeleteErr
  596.   If MsgBox("确认是否删除此记录信息?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  597.   With adoPrimaryRS
  598.     .Delete
  599.     .MoveNext
  600.     If .EOF Then .MoveLast
  601.   End With
  602.   On Error GoTo 0
  603.   Exit Sub
  604. DeleteErr:
  605.   MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
  606. End Sub
  607. Private Sub cmdRefresh_Click()
  608.   'This is only needed for multi user apps
  609.   On Error GoTo RefreshErr
  610.   adoPrimaryRS.Requery
  611.   On Error GoTo 0
  612.   Exit Sub
  613. RefreshErr:
  614.    MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
  615. End Sub
  616. Private Sub cmdEdit_Click()
  617.   On Error GoTo EditErr
  618.   mbEditFlag = True
  619.   SetButtons False
  620.   On Error GoTo 0
  621.   Exit Sub
  622. EditErr:
  623.    MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
  624. End Sub
  625. Private Sub cmdCancel_Click()
  626.  ' On Error Resume Next
  627.  On Error GoTo CancelErr
  628.   mbEditFlag = False
  629.   mbAddNewFlag = False
  630.   adoPrimaryRS.CancelUpdate
  631.   If mvBookMark > 0 Then
  632.    adoPrimaryRS.Bookmark = mvBookMark
  633.   Else
  634.    adoPrimaryRS.MoveFirst
  635.   End If
  636.  SetButtons True
  637.   Exit Sub
  638. CancelErr:
  639.    
  640.    MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
  641. End Sub
  642. Private Sub cmdUpdate_Click()
  643.   On Error GoTo UpdateErr
  644.   If MsgBox("是否确认此操作?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  645.   adoPrimaryRS.UpdateBatch adAffectAll
  646.   If mbAddNewFlag Then
  647.     adoPrimaryRS.MoveLast              'move to the new record
  648.   End If
  649.   mbEditFlag = False
  650.   mbAddNewFlag = False
  651.   SetButtons True
  652.   On Error GoTo 0
  653.   Exit Sub
  654. UpdateErr:
  655.    MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
  656. End Sub
  657. Private Sub cmdClose_Click()
  658.   RSGL.Enabled = True
  659.   Unload Me
  660. End Sub
  661. Private Sub SetButtons(bVal As Boolean)
  662.   CmdAdd.Visible = bVal
  663.   cmdEdit.Visible = bVal
  664.   cmdUpdate.Visible = Not bVal
  665.   cmdCancel.Visible = Not bVal
  666.   CmdDelete.Visible = bVal
  667.   cmdClose.Visible = bVal
  668.   cmdRefresh.Visible = bVal
  669.   If bVal Then
  670.    Set DataGrid1.DataSource = adoPrimaryRS
  671.   Else
  672.    Set DataGrid1.DataSource = Nothing
  673.   End If
  674.   
  675.   txtFields(0).Enabled = Not bVal
  676.   txtFields(1).Enabled = Not bVal
  677.   txtFields(2).Enabled = Not bVal
  678.   txtFields(3).Enabled = Not bVal
  679.   txtFields(7).Enabled = Not bVal
  680.   txtFields(8).Enabled = Not bVal
  681.   DTPicker1.Enabled = Not bVal
  682.   DTPicker2.Enabled = Not bVal
  683.   
  684. End Sub
  685. Private Sub txtFields_Change(Index As Integer)
  686.   If IsNumeric(txtFields(7)) And IsNumeric(txtFields(8)) Then
  687.   
  688.    txtFields(9) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * tcjj
  689.    txtFields(11) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * hrzh
  690.    txtFields(12) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * grjn
  691.  
  692.    txtFields(10) = CDbl(txtFields(11)) + CDbl(txtFields(12))
  693.   End If
  694. End Sub
  695. Private Sub txtFields_KeyPress(Index As Integer, KeyAscii As Integer)
  696. If KeyAscii = vbKeyReturn Then
  697.     SendKeys "{TAB}"
  698. End If
  699. End Sub
  700. Private Sub txtFields_LostFocus(Index As Integer)
  701. If Not IsNumeric(txtFields(7).Text) And (txtFields(7).Text <> "") Then
  702.     MsgBox "请在“月数”中输入数字", vbExclamation + vbOKOnly, pTitle
  703.      txtFields(7).SetFocus
  704.      txtFields(7).SelLength = Len(txtFields(7))
  705.      txtFields(7).SelStart = 0
  706. End If
  707. If Not IsNumeric(txtFields(8).Text) And (txtFields(8).Text <> "") Then
  708.     MsgBox "请在“职工月缴费基数”中输入数字", vbExclamation + vbOKOnly, pTitle
  709.      txtFields(8).SetFocus
  710.      txtFields(8).SelLength = Len(txtFields(8))
  711.      txtFields(8).SelStart = 0
  712. End If
  713. End Sub