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

企业管理

开发平台:

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_DaBingYiLiao 
  7.    BorderStyle     =   3  'Fixed Dialog
  8.    Caption         =   "大病医疗记录"
  9.    ClientHeight    =   6015
  10.    ClientLeft      =   1095
  11.    ClientTop       =   330
  12.    ClientWidth     =   9585
  13.    ControlBox      =   0   'False
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form1"
  16.    LockControls    =   -1  'True
  17.    MaxButton       =   0   'False
  18.    MinButton       =   0   'False
  19.    ScaleHeight     =   6015
  20.    ScaleWidth      =   9585
  21.    StartUpPosition =   2  '屏幕中心
  22.    WhatsThisHelp   =   -1  'True
  23.    Begin VB.Frame Frame1 
  24.       BeginProperty Font 
  25.          Name            =   "MS Sans Serif"
  26.          Size            =   8.25
  27.          Charset         =   0
  28.          Weight          =   400
  29.          Underline       =   0   'False
  30.          Italic          =   0   'False
  31.          Strikethrough   =   0   'False
  32.       EndProperty
  33.       Height          =   5655
  34.       Left            =   120
  35.       TabIndex        =   0
  36.       Top             =   120
  37.       Width           =   9255
  38.       Begin TabDlg.SSTab SSTab1 
  39.          Height          =   5055
  40.          Left            =   360
  41.          TabIndex        =   1
  42.          Top             =   360
  43.          Width           =   8655
  44.          _ExtentX        =   15266
  45.          _ExtentY        =   8916
  46.          _Version        =   393216
  47.          Tabs            =   2
  48.          TabHeight       =   520
  49.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  50.             Name            =   "宋体"
  51.             Size            =   9
  52.             Charset         =   134
  53.             Weight          =   400
  54.             Underline       =   0   'False
  55.             Italic          =   0   'False
  56.             Strikethrough   =   0   'False
  57.          EndProperty
  58.          TabCaption(0)   =   "编辑"
  59.          TabPicture(0)   =   "F_DaBingYiLiao.frx":0000
  60.          Tab(0).ControlEnabled=   -1  'True
  61.          Tab(0).Control(0)=   "Frame2"
  62.          Tab(0).Control(0).Enabled=   0   'False
  63.          Tab(0).Control(1)=   "Picture1"
  64.          Tab(0).Control(1).Enabled=   0   'False
  65.          Tab(0).ControlCount=   2
  66.          TabCaption(1)   =   "列表"
  67.          TabPicture(1)   =   "F_DaBingYiLiao.frx":001C
  68.          Tab(1).ControlEnabled=   0   'False
  69.          Tab(1).Control(0)=   "Frame4"
  70.          Tab(1).Control(0).Enabled=   0   'False
  71.          Tab(1).ControlCount=   1
  72.          Begin VB.PictureBox Picture1 
  73.             Appearance      =   0  'Flat
  74.             BorderStyle     =   0  'None
  75.             BeginProperty Font 
  76.                Name            =   "MS Sans Serif"
  77.                Size            =   8.25
  78.                Charset         =   0
  79.                Weight          =   400
  80.                Underline       =   0   'False
  81.                Italic          =   0   'False
  82.                Strikethrough   =   0   'False
  83.             EndProperty
  84.             ForeColor       =   &H80000008&
  85.             Height          =   660
  86.             Left            =   1320
  87.             ScaleHeight     =   660
  88.             ScaleWidth      =   6840
  89.             TabIndex        =   21
  90.             Top             =   4200
  91.             Width           =   6840
  92.             Begin Threed.SSCommand cmdClose 
  93.                Height          =   330
  94.                Left            =   5640
  95.                TabIndex        =   22
  96.                Top             =   240
  97.                Width           =   1095
  98.                _Version        =   65536
  99.                _ExtentX        =   1931
  100.                _ExtentY        =   573
  101.                _StockProps     =   78
  102.                Caption         =   "&Q.关 闭"
  103.                Font3D          =   1
  104.             End
  105.             Begin Threed.SSCommand cmdRefresh 
  106.                Height          =   330
  107.                Left            =   4440
  108.                TabIndex        =   23
  109.                Top             =   240
  110.                Width           =   1095
  111.                _Version        =   65536
  112.                _ExtentX        =   1931
  113.                _ExtentY        =   573
  114.                _StockProps     =   78
  115.                Caption         =   "&R.刷 新"
  116.                Font3D          =   1
  117.             End
  118.             Begin Threed.SSCommand CmdAdd 
  119.                Height          =   330
  120.                Left            =   840
  121.                TabIndex        =   24
  122.                Top             =   240
  123.                Width           =   1095
  124.                _Version        =   65536
  125.                _ExtentX        =   1931
  126.                _ExtentY        =   573
  127.                _StockProps     =   78
  128.                Caption         =   "&A.增 加"
  129.                Font3D          =   1
  130.             End
  131.             Begin Threed.SSCommand cmdEdit 
  132.                Height          =   330
  133.                Left            =   2040
  134.                TabIndex        =   25
  135.                Top             =   240
  136.                Width           =   1095
  137.                _Version        =   65536
  138.                _ExtentX        =   1931
  139.                _ExtentY        =   573
  140.                _StockProps     =   78
  141.                Caption         =   "&E.编 辑"
  142.                Font3D          =   1
  143.             End
  144.             Begin Threed.SSCommand CmdDelete 
  145.                Height          =   330
  146.                Left            =   3240
  147.                TabIndex        =   26
  148.                Top             =   240
  149.                Width           =   1095
  150.                _Version        =   65536
  151.                _ExtentX        =   1931
  152.                _ExtentY        =   573
  153.                _StockProps     =   78
  154.                Caption         =   "&D.删 除"
  155.                Font3D          =   1
  156.             End
  157.             Begin Threed.SSCommand cmdCancel 
  158.                Height          =   330
  159.                Left            =   5640
  160.                TabIndex        =   27
  161.                Top             =   240
  162.                Width           =   1095
  163.                _Version        =   65536
  164.                _ExtentX        =   1931
  165.                _ExtentY        =   573
  166.                _StockProps     =   78
  167.                Caption         =   "&C.取消"
  168.                Font3D          =   1
  169.             End
  170.             Begin Threed.SSCommand cmdUpdate 
  171.                Height          =   330
  172.                Left            =   4440
  173.                TabIndex        =   28
  174.                Top             =   240
  175.                Width           =   1095
  176.                _Version        =   65536
  177.                _ExtentX        =   1931
  178.                _ExtentY        =   573
  179.                _StockProps     =   78
  180.                Caption         =   "&Y.保存"
  181.                Font3D          =   1
  182.             End
  183.          End
  184.          Begin VB.Frame Frame4 
  185.             BeginProperty Font 
  186.                Name            =   "MS Sans Serif"
  187.                Size            =   8.25
  188.                Charset         =   0
  189.                Weight          =   400
  190.                Underline       =   0   'False
  191.                Italic          =   0   'False
  192.                Strikethrough   =   0   'False
  193.             EndProperty
  194.             Height          =   3255
  195.             Left            =   -74760
  196.             TabIndex        =   14
  197.             Top             =   480
  198.             Width           =   7335
  199.             Begin MSDataGridLib.DataGrid DataGrid1 
  200.                Height          =   2655
  201.                Left            =   240
  202.                TabIndex        =   15
  203.                Top             =   360
  204.                Width           =   6855
  205.                _ExtentX        =   12091
  206.                _ExtentY        =   4683
  207.                _Version        =   393216
  208.                AllowUpdate     =   0   'False
  209.                HeadLines       =   1
  210.                RowHeight       =   14
  211.                BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  212.                   Name            =   "MS Sans Serif"
  213.                   Size            =   8.25
  214.                   Charset         =   0
  215.                   Weight          =   400
  216.                   Underline       =   0   'False
  217.                   Italic          =   0   'False
  218.                   Strikethrough   =   0   'False
  219.                EndProperty
  220.                BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  221.                   Name            =   "宋体"
  222.                   Size            =   9
  223.                   Charset         =   134
  224.                   Weight          =   400
  225.                   Underline       =   0   'False
  226.                   Italic          =   0   'False
  227.                   Strikethrough   =   0   'False
  228.                EndProperty
  229.                ColumnCount     =   2
  230.                BeginProperty Column00 
  231.                   DataField       =   ""
  232.                   Caption         =   ""
  233.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  234.                      Type            =   0
  235.                      Format          =   ""
  236.                      HaveTrueFalseNull=   0
  237.                      FirstDayOfWeek  =   0
  238.                      FirstWeekOfYear =   0
  239.                      LCID            =   2052
  240.                      SubFormatType   =   0
  241.                   EndProperty
  242.                EndProperty
  243.                BeginProperty Column01 
  244.                   DataField       =   ""
  245.                   Caption         =   ""
  246.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  247.                      Type            =   0
  248.                      Format          =   ""
  249.                      HaveTrueFalseNull=   0
  250.                      FirstDayOfWeek  =   0
  251.                      FirstWeekOfYear =   0
  252.                      LCID            =   2052
  253.                      SubFormatType   =   0
  254.                   EndProperty
  255.                EndProperty
  256.                SplitCount      =   1
  257.                BeginProperty Split0 
  258.                   BeginProperty Column00 
  259.                   EndProperty
  260.                   BeginProperty Column01 
  261.                   EndProperty
  262.                EndProperty
  263.             End
  264.          End
  265.          Begin VB.Frame Frame2 
  266.             BeginProperty Font 
  267.                Name            =   "MS Sans Serif"
  268.                Size            =   8.25
  269.                Charset         =   0
  270.                Weight          =   400
  271.                Underline       =   0   'False
  272.                Italic          =   0   'False
  273.                Strikethrough   =   0   'False
  274.             EndProperty
  275.             Height          =   3375
  276.             Left            =   240
  277.             TabIndex        =   2
  278.             Top             =   720
  279.             Width           =   8175
  280.             Begin VB.TextBox txtFields 
  281.                DataField       =   "单位应缴额"
  282.                Enabled         =   0   'False
  283.                Height          =   285
  284.                Index           =   7
  285.                Left            =   1560
  286.                TabIndex        =   20
  287.                Top             =   2880
  288.                Width           =   2055
  289.             End
  290.             Begin VB.TextBox txtFields 
  291.                DataField       =   "企业编号"
  292.                Enabled         =   0   'False
  293.                Height          =   285
  294.                Index           =   6
  295.                Left            =   1560
  296.                TabIndex        =   18
  297.                Top             =   480
  298.                Width           =   2055
  299.             End
  300.             Begin MSComCtl2.DTPicker DTPicker1 
  301.                DataField       =   "时间"
  302.                Height          =   300
  303.                Left            =   5880
  304.                TabIndex        =   16
  305.                Top             =   1080
  306.                Width           =   2055
  307.                _ExtentX        =   3625
  308.                _ExtentY        =   529
  309.                _Version        =   393216
  310.                CheckBox        =   -1  'True
  311.                DateIsNull      =   -1  'True
  312.                Format          =   69861377
  313.                CurrentDate     =   36187
  314.             End
  315.             Begin VB.TextBox txtFields 
  316.                DataField       =   "个人应缴额"
  317.                Enabled         =   0   'False
  318.                Height          =   285
  319.                Index           =   5
  320.                Left            =   5880
  321.                TabIndex        =   13
  322.                Top             =   2280
  323.                Width           =   2055
  324.             End
  325.             Begin VB.TextBox txtFields 
  326.                DataField       =   "单位应缴额"
  327.                Enabled         =   0   'False
  328.                Height          =   285
  329.                Index           =   4
  330.                Left            =   1560
  331.                TabIndex        =   11
  332.                Top             =   2280
  333.                Width           =   2055
  334.             End
  335.             Begin VB.TextBox txtFields 
  336.                DataField       =   "上年月平均工资总额"
  337.                Height          =   285
  338.                Index           =   3
  339.                Left            =   5880
  340.                TabIndex        =   9
  341.                Top             =   1680
  342.                Width           =   2055
  343.             End
  344.             Begin VB.TextBox txtFields 
  345.                DataField       =   "在职职工数"
  346.                Height          =   285
  347.                Index           =   2
  348.                Left            =   1560
  349.                TabIndex        =   7
  350.                Top             =   1680
  351.                Width           =   2055
  352.             End
  353.             Begin VB.TextBox txtFields 
  354.                DataField       =   "年度"
  355.                Height          =   285
  356.                Index           =   0
  357.                Left            =   1560
  358.                TabIndex        =   4
  359.                Top             =   1080
  360.                Width           =   2055
  361.             End
  362.             Begin VB.Label lblLabels 
  363.                Caption         =   "企业编号:"
  364.                Height          =   255
  365.                Index           =   7
  366.                Left            =   240
  367.                TabIndex        =   19
  368.                Top             =   480
  369.                Width           =   1815
  370.             End
  371.             Begin VB.Label lblLabels 
  372.                Caption         =   "应缴金额合计:"
  373.                Height          =   255
  374.                Index           =   6
  375.                Left            =   240
  376.                TabIndex        =   17
  377.                Top             =   2880
  378.                Width           =   1815
  379.             End
  380.             Begin VB.Label lblLabels 
  381.                Caption         =   "个人应缴额:"
  382.                Height          =   255
  383.                Index           =   5
  384.                Left            =   4080
  385.                TabIndex        =   12
  386.                Top             =   2280
  387.                Width           =   1815
  388.             End
  389.             Begin VB.Label lblLabels 
  390.                Caption         =   "单位应缴额:"
  391.                Height          =   255
  392.                Index           =   4
  393.                Left            =   240
  394.                TabIndex        =   10
  395.                Top             =   2280
  396.                Width           =   1335
  397.             End
  398.             Begin VB.Label lblLabels 
  399.                Caption         =   "上年月平均工资总额:"
  400.                Height          =   255
  401.                Index           =   3
  402.                Left            =   4080
  403.                TabIndex        =   8
  404.                Top             =   1680
  405.                Width           =   1815
  406.             End
  407.             Begin VB.Label lblLabels 
  408.                Caption         =   "在职职工数:"
  409.                Height          =   255
  410.                Index           =   2
  411.                Left            =   240
  412.                TabIndex        =   6
  413.                Top             =   1680
  414.                Width           =   1815
  415.             End
  416.             Begin VB.Label lblLabels 
  417.                Caption         =   "时间:"
  418.                Height          =   255
  419.                Index           =   1
  420.                Left            =   4080
  421.                TabIndex        =   5
  422.                Top             =   1080
  423.                Width           =   1815
  424.             End
  425.             Begin VB.Label lblLabels 
  426.                Caption         =   "年度:"
  427.                Height          =   255
  428.                Index           =   0
  429.                Left            =   240
  430.                TabIndex        =   3
  431.                Top             =   1080
  432.                Width           =   1815
  433.             End
  434.          End
  435.       End
  436.    End
  437. End
  438. Attribute VB_Name = "F_DaBingYiLiao"
  439. Attribute VB_GlobalNameSpace = False
  440. Attribute VB_Creatable = False
  441. Attribute VB_PredeclaredId = True
  442. Attribute VB_Exposed = False
  443. Dim WithEvents adoPrimaryRS As Recordset
  444. Attribute adoPrimaryRS.VB_VarHelpID = -1
  445. Dim mvBookMark As Variant
  446. Dim mbEditFlag As Boolean
  447. Dim mbAddNewFlag As Boolean
  448. Private Sub Form_Load()
  449. Dim oText As TextBox
  450.   
  451.   Set adoPrimaryRS = New Recordset
  452.   adoPrimaryRS.Open "select * from 大病医疗记录 Order by 年度", db, adOpenStatic, adLockOptimistic
  453.   
  454.  Set DataGrid1.DataSource = adoPrimaryRS
  455.  
  456.  SetButtons True
  457.  
  458.    
  459.   'Bind the text boxes to the data provider
  460.   For Each oText In Me.txtFields
  461.     Set oText.DataSource = adoPrimaryRS
  462.   Next
  463.   
  464.   
  465.     Set DTPicker1.DataSource = adoPrimaryRS
  466.   
  467. End Sub
  468. Private Sub Form_Unload(Cancel As Integer)
  469.   Screen.MousePointer = vbDefault
  470. End Sub
  471. Private Sub cmdAdd_Click()
  472.   On Error GoTo AddErr
  473.   
  474.   
  475.  With adoPrimaryRS
  476.     If Not (.BOF And .EOF) Then
  477.       mvBookMark = .Bookmark
  478.     End If
  479.     .AddNew
  480.     mbAddNewFlag = True
  481.     SetButtons False
  482.   End With
  483.   Exit Sub
  484. AddErr:
  485.   MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
  486.   
  487. End Sub
  488. Private Sub cmdDelete_Click()
  489.   On Error GoTo DeleteErr
  490.   With adoPrimaryRS
  491.     .Delete
  492.     .MoveNext
  493.     If .EOF Then .MoveLast
  494.   End With
  495.   Exit Sub
  496. DeleteErr:
  497.   MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
  498. End Sub
  499. Private Sub cmdRefresh_Click()
  500.   'This is only needed for multi user apps
  501.   On Error GoTo RefreshErr
  502.   adoPrimaryRS.Requery
  503.   Exit Sub
  504. RefreshErr:
  505.    MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
  506. End Sub
  507. Private Sub cmdEdit_Click()
  508.   On Error GoTo EditErr
  509.   mbEditFlag = True
  510.   SetButtons False
  511.   Exit Sub
  512. EditErr:
  513.    MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
  514. End Sub
  515. Private Sub cmdCancel_Click()
  516.  ' On Error Resume Next
  517.  On Error GoTo CancelErr
  518.   mbEditFlag = False
  519.   mbAddNewFlag = False
  520.   adoPrimaryRS.CancelUpdate
  521.   If mvBookMark > 0 Then
  522.    adoPrimaryRS.Bookmark = mvBookMark
  523.   Else
  524.    adoPrimaryRS.MoveFirst
  525.   End If
  526.  SetButtons True
  527.   Exit Sub
  528. CancelErr:
  529.    
  530.    MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
  531. End Sub
  532. Private Sub cmdUpdate_Click()
  533.   On Error GoTo UpdateErr
  534.   adoPrimaryRS.UpdateBatch adAffectAll
  535.   If mbAddNewFlag Then
  536.     adoPrimaryRS.MoveLast              'move to the new record
  537.   End If
  538.   mbEditFlag = False
  539.   mbAddNewFlag = False
  540.   SetButtons True
  541.   Exit Sub
  542. UpdateErr:
  543.    MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
  544. End Sub
  545. Private Sub cmdClose_Click()
  546.   RSGL.Enabled = True
  547.   Unload Me
  548. End Sub
  549. Private Sub SetButtons(bVal As Boolean)
  550. Dim oTEX  As TextBox
  551.   CmdAdd.Visible = bVal
  552.   cmdEdit.Visible = bVal
  553.   cmdUpdate.Visible = Not bVal
  554.   cmdCancel.Visible = Not bVal
  555.   CmdDelete.Visible = bVal
  556.   cmdClose.Visible = bVal
  557.   cmdRefresh.Visible = bVal
  558.   
  559.   
  560.   For Each oText In Me.txtFields
  561.      oText.Enabled = Not bVal
  562.   Next
  563.   
  564.   If bVal Then
  565.    Set DataGrid1.DataSource = adoPrimaryRS
  566.   Else
  567.    Set DataGrid1.DataSource = Nothing
  568.   End If
  569.   
  570.   
  571.    txtFields(0).Enabled = Not bVal
  572.    txtFields(2).Enabled = Not bVal
  573.    txtFields(3).Enabled = Not bVal
  574.    DTPicker1.Enabled = Not bVal
  575.    
  576. End Sub
  577. Private Sub txtFields_Change(Index As Integer)
  578. txtFields(6).Text = "S344"
  579.   If IsNumeric(txtFields(2).Text) And IsNumeric(txtFields(3).Text) Then
  580.    
  581.    txtFields(4) = CDbl(txtFields(2)) * CDbl(txtFields(3)) * 0.25
  582.    txtFields(5) = CDbl(txtFields(2)) * CDbl(txtFields(3)) * 0.01
  583.  
  584.    txtFields(7) = CDbl(txtFields(4)) + CDbl(txtFields(5))
  585.   
  586.   End If
  587.  
  588.   
  589.  
  590.   
  591. End Sub
  592. Private Sub txtFields_LostFocus(Index As Integer)
  593. If Not IsNumeric(txtFields(0).Text) And (txtFields(0).Text <> "") Then
  594.     MsgBox "请在“年度”中输入数字", vbExclamation + vbOKOnly, pTitle
  595.      txtFields(0).SetFocus
  596.      txtFields(0).SelLength = Len(txtFields(0))
  597.      txtFields(0).SelStart = 0
  598. End If
  599. If Not IsNumeric(txtFields(2).Text) And (txtFields(2).Text <> "") Then
  600.     MsgBox "请在“在职职工数”中输入数字", vbExclamation + vbOKOnly, pTitle
  601.      txtFields(2).SetFocus
  602.      txtFields(2).SelLength = Len(txtFields(2))
  603.      txtFields(2).SelStart = 0
  604. End If
  605. If Not IsNumeric(txtFields(3).Text) And (txtFields(3).Text <> "") Then
  606.     MsgBox "请在“上年月平均工资总额”中输入数字", vbExclamation + vbOKOnly, pTitle
  607.      txtFields(3).SetFocus
  608.      txtFields(3).SelLength = Len(txtFields(3))
  609.      txtFields(3).SelStart = 0
  610. End If
  611. End Sub