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

企业管理

开发平台:

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_ChengFa 
  7.    BorderStyle     =   3  'Fixed Dialog
  8.    Caption         =   "惩罚"
  9.    ClientHeight    =   7635
  10.    ClientLeft      =   1095
  11.    ClientTop       =   330
  12.    ClientWidth     =   10665
  13.    KeyPreview      =   -1  'True
  14.    LinkTopic       =   "Form1"
  15.    LockControls    =   -1  'True
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    Moveable        =   0   'False
  19.    ScaleHeight     =   7635
  20.    ScaleWidth      =   10665
  21.    StartUpPosition =   2  '屏幕中心
  22.    Begin VB.Frame Frame1 
  23.       BeginProperty Font 
  24.          Name            =   "MS Sans Serif"
  25.          Size            =   8.25
  26.          Charset         =   0
  27.          Weight          =   400
  28.          Underline       =   0   'False
  29.          Italic          =   0   'False
  30.          Strikethrough   =   0   'False
  31.       EndProperty
  32.       Height          =   7455
  33.       Left            =   120
  34.       TabIndex        =   23
  35.       Top             =   0
  36.       Width           =   10335
  37.       Begin TabDlg.SSTab SSTab1 
  38.          Height          =   6900
  39.          Left            =   240
  40.          TabIndex        =   24
  41.          Top             =   360
  42.          Width           =   9915
  43.          _ExtentX        =   17489
  44.          _ExtentY        =   12171
  45.          _Version        =   393216
  46.          Tabs            =   2
  47.          TabHeight       =   520
  48.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  49.             Name            =   "宋体"
  50.             Size            =   9
  51.             Charset         =   134
  52.             Weight          =   400
  53.             Underline       =   0   'False
  54.             Italic          =   0   'False
  55.             Strikethrough   =   0   'False
  56.          EndProperty
  57.          TabCaption(0)   =   "编    辑"
  58.          TabPicture(0)   =   "F_ChengFa.frx":0000
  59.          Tab(0).ControlEnabled=   -1  'True
  60.          Tab(0).Control(0)=   "Frame2"
  61.          Tab(0).Control(0).Enabled=   0   'False
  62.          Tab(0).Control(1)=   "Picture1"
  63.          Tab(0).Control(1).Enabled=   0   'False
  64.          Tab(0).ControlCount=   2
  65.          TabCaption(1)   =   "列    表"
  66.          TabPicture(1)   =   "F_ChengFa.frx":001C
  67.          Tab(1).ControlEnabled=   0   'False
  68.          Tab(1).Control(0)=   "Frame3"
  69.          Tab(1).Control(0).Enabled=   0   'False
  70.          Tab(1).ControlCount=   1
  71.          Begin VB.PictureBox Picture1 
  72.             Appearance      =   0  'Flat
  73.             BorderStyle     =   0  'None
  74.             BeginProperty Font 
  75.                Name            =   "MS Sans Serif"
  76.                Size            =   8.25
  77.                Charset         =   0
  78.                Weight          =   400
  79.                Underline       =   0   'False
  80.                Italic          =   0   'False
  81.                Strikethrough   =   0   'False
  82.             EndProperty
  83.             ForeColor       =   &H80000008&
  84.             Height          =   420
  85.             Left            =   3000
  86.             ScaleHeight     =   420
  87.             ScaleWidth      =   6720
  88.             TabIndex        =   36
  89.             Top             =   6360
  90.             Width           =   6720
  91.             Begin Threed.SSCommand cmdClose 
  92.                Height          =   330
  93.                Left            =   5520
  94.                TabIndex        =   22
  95.                Top             =   0
  96.                Width           =   1095
  97.                _Version        =   65536
  98.                _ExtentX        =   1931
  99.                _ExtentY        =   573
  100.                _StockProps     =   78
  101.                Caption         =   "&Q.关 闭"
  102.                Font3D          =   1
  103.             End
  104.             Begin Threed.SSCommand CmdAdd 
  105.                Height          =   330
  106.                Left            =   720
  107.                TabIndex        =   18
  108.                Top             =   0
  109.                Width           =   1095
  110.                _Version        =   65536
  111.                _ExtentX        =   1931
  112.                _ExtentY        =   573
  113.                _StockProps     =   78
  114.                Caption         =   "&A.增 加"
  115.                Font3D          =   1
  116.             End
  117.             Begin Threed.SSCommand cmdEdit 
  118.                Height          =   330
  119.                Left            =   1920
  120.                TabIndex        =   19
  121.                Top             =   0
  122.                Width           =   1095
  123.                _Version        =   65536
  124.                _ExtentX        =   1931
  125.                _ExtentY        =   573
  126.                _StockProps     =   78
  127.                Caption         =   "&E.编 辑"
  128.                Font3D          =   1
  129.             End
  130.             Begin Threed.SSCommand CmdDelete 
  131.                Height          =   330
  132.                Left            =   3120
  133.                TabIndex        =   20
  134.                Top             =   0
  135.                Width           =   1095
  136.                _Version        =   65536
  137.                _ExtentX        =   1931
  138.                _ExtentY        =   573
  139.                _StockProps     =   78
  140.                Caption         =   "&D.删 除"
  141.                Font3D          =   1
  142.             End
  143.             Begin Threed.SSCommand cmdUpdate 
  144.                Height          =   330
  145.                Left            =   4320
  146.                TabIndex        =   48
  147.                Top             =   0
  148.                Width           =   1095
  149.                _Version        =   65536
  150.                _ExtentX        =   1931
  151.                _ExtentY        =   573
  152.                _StockProps     =   78
  153.                Caption         =   "&Y.保 存"
  154.                Font3D          =   1
  155.             End
  156.             Begin Threed.SSCommand cmdRefresh 
  157.                Height          =   330
  158.                Left            =   4320
  159.                TabIndex        =   21
  160.                Top             =   0
  161.                Width           =   1095
  162.                _Version        =   65536
  163.                _ExtentX        =   1931
  164.                _ExtentY        =   573
  165.                _StockProps     =   78
  166.                Caption         =   "&R.刷新"
  167.                Font3D          =   1
  168.             End
  169.             Begin Threed.SSCommand cmdCancel 
  170.                Height          =   330
  171.                Left            =   5520
  172.                TabIndex        =   49
  173.                Top             =   0
  174.                Width           =   1095
  175.                _Version        =   65536
  176.                _ExtentX        =   1931
  177.                _ExtentY        =   573
  178.                _StockProps     =   78
  179.                Caption         =   "&C.取消"
  180.                Font3D          =   1
  181.             End
  182.          End
  183.          Begin VB.Frame Frame3 
  184.             BeginProperty Font 
  185.                Name            =   "MS Sans Serif"
  186.                Size            =   8.25
  187.                Charset         =   0
  188.                Weight          =   400
  189.                Underline       =   0   'False
  190.                Italic          =   0   'False
  191.                Strikethrough   =   0   'False
  192.             EndProperty
  193.             Height          =   5415
  194.             Left            =   -74760
  195.             TabIndex        =   33
  196.             Top             =   480
  197.             Width           =   9495
  198.             Begin MSDataGridLib.DataGrid DataGrid1 
  199.                Height          =   4695
  200.                Left            =   240
  201.                TabIndex        =   34
  202.                Top             =   360
  203.                Width           =   9015
  204.                _ExtentX        =   15901
  205.                _ExtentY        =   8281
  206.                _Version        =   393216
  207.                AllowUpdate     =   0   'False
  208.                HeadLines       =   1
  209.                RowHeight       =   14
  210.                BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  211.                   Name            =   "MS Sans Serif"
  212.                   Size            =   8.25
  213.                   Charset         =   0
  214.                   Weight          =   400
  215.                   Underline       =   0   'False
  216.                   Italic          =   0   'False
  217.                   Strikethrough   =   0   'False
  218.                EndProperty
  219.                BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  220.                   Name            =   "宋体"
  221.                   Size            =   9
  222.                   Charset         =   134
  223.                   Weight          =   400
  224.                   Underline       =   0   'False
  225.                   Italic          =   0   'False
  226.                   Strikethrough   =   0   'False
  227.                EndProperty
  228.                ColumnCount     =   2
  229.                BeginProperty Column00 
  230.                   DataField       =   ""
  231.                   Caption         =   ""
  232.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  233.                      Type            =   0
  234.                      Format          =   ""
  235.                      HaveTrueFalseNull=   0
  236.                      FirstDayOfWeek  =   0
  237.                      FirstWeekOfYear =   0
  238.                      LCID            =   2052
  239.                      SubFormatType   =   0
  240.                   EndProperty
  241.                EndProperty
  242.                BeginProperty Column01 
  243.                   DataField       =   ""
  244.                   Caption         =   ""
  245.                   BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  246.                      Type            =   0
  247.                      Format          =   ""
  248.                      HaveTrueFalseNull=   0
  249.                      FirstDayOfWeek  =   0
  250.                      FirstWeekOfYear =   0
  251.                      LCID            =   2052
  252.                      SubFormatType   =   0
  253.                   EndProperty
  254.                EndProperty
  255.                SplitCount      =   1
  256.                BeginProperty Split0 
  257.                   BeginProperty Column00 
  258.                   EndProperty
  259.                   BeginProperty Column01 
  260.                   EndProperty
  261.                EndProperty
  262.             End
  263.          End
  264.          Begin VB.Frame Frame2 
  265.             BeginProperty Font 
  266.                Name            =   "MS Sans Serif"
  267.                Size            =   8.25
  268.                Charset         =   0
  269.                Weight          =   400
  270.                Underline       =   0   'False
  271.                Italic          =   0   'False
  272.                Strikethrough   =   0   'False
  273.             EndProperty
  274.             Height          =   5775
  275.             Left            =   240
  276.             TabIndex        =   25
  277.             Top             =   480
  278.             Width           =   9375
  279.             Begin VB.TextBox txtFields 
  280.                Appearance      =   0  'Flat
  281.                DataField       =   "款"
  282.                Height          =   285
  283.                Index           =   9
  284.                Left            =   4200
  285.                TabIndex        =   1
  286.                Top             =   360
  287.                Width           =   1815
  288.             End
  289.             Begin VB.TextBox txtFields 
  290.                Appearance      =   0  'Flat
  291.                DataField       =   "条"
  292.                Height          =   285
  293.                Index           =   4
  294.                Left            =   1680
  295.                TabIndex        =   0
  296.                Top             =   360
  297.                Width           =   1815
  298.             End
  299.             Begin VB.TextBox txtFields 
  300.                Appearance      =   0  'Flat
  301.                DataField       =   "本部门经理签字"
  302.                Height          =   285
  303.                Index           =   8
  304.                Left            =   1080
  305.                TabIndex        =   12
  306.                Top             =   4320
  307.                Width           =   1815
  308.             End
  309.             Begin VB.TextBox txtFields 
  310.                Appearance      =   0  'Flat
  311.                DataField       =   "人力资源部经理签字"
  312.                Height          =   285
  313.                Index           =   10
  314.                Left            =   4440
  315.                TabIndex        =   13
  316.                Top             =   4320
  317.                Width           =   1815
  318.             End
  319.             Begin VB.TextBox txtFields 
  320.                Appearance      =   0  'Flat
  321.                DataField       =   "总经理签字"
  322.                Height          =   285
  323.                Index           =   12
  324.                Left            =   7320
  325.                TabIndex        =   14
  326.                Top             =   4320
  327.                Width           =   1815
  328.             End
  329.             Begin VB.ComboBox Combo1 
  330.                Appearance      =   0  'Flat
  331.                DataField       =   "惩罚项目"
  332.                Height          =   300
  333.                Left            =   1080
  334.                TabIndex        =   8
  335.                Top             =   1800
  336.                Width           =   1815
  337.             End
  338.             Begin VB.TextBox txtFields 
  339.                Appearance      =   0  'Flat
  340.                DataField       =   "性别"
  341.                Height          =   285
  342.                Index           =   7
  343.                Left            =   4200
  344.                TabIndex        =   6
  345.                Top             =   1320
  346.                Width           =   1815
  347.             End
  348.             Begin MSComCtl2.DTPicker DTPicker1 
  349.                DataField       =   "惩罚时间"
  350.                Height          =   300
  351.                Left            =   4200
  352.                TabIndex        =   9
  353.                Top             =   1800
  354.                Width           =   1815
  355.                _ExtentX        =   3201
  356.                _ExtentY        =   529
  357.                _Version        =   393216
  358.                CheckBox        =   -1  'True
  359.                DateIsNull      =   -1  'True
  360.                Format          =   69795841
  361.                CurrentDate     =   36186
  362.             End
  363.             Begin VB.TextBox txtFields 
  364.                Appearance      =   0  'Flat
  365.                DataField       =   "说明"
  366.                Height          =   765
  367.                Index           =   6
  368.                Left            =   1080
  369.                MultiLine       =   -1  'True
  370.                ScrollBars      =   2  'Vertical
  371.                TabIndex        =   11
  372.                Top             =   3240
  373.                Width           =   8055
  374.             End
  375.             Begin VB.TextBox txtFields 
  376.                Appearance      =   0  'Flat
  377.                DataField       =   "惩罚项目"
  378.                Height          =   765
  379.                Index           =   5
  380.                Left            =   1080
  381.                MultiLine       =   -1  'True
  382.                ScrollBars      =   2  'Vertical
  383.                TabIndex        =   10
  384.                Top             =   2280
  385.                Width           =   8055
  386.             End
  387.             Begin VB.TextBox txtFields 
  388.                Appearance      =   0  'Flat
  389.                DataField       =   "岗位"
  390.                Height          =   285
  391.                Index           =   3
  392.                Left            =   1080
  393.                TabIndex        =   5
  394.                Top             =   1320
  395.                Width           =   1815
  396.             End
  397.             Begin VB.TextBox txtFields 
  398.                Appearance      =   0  'Flat
  399.                DataField       =   "部门"
  400.                Height          =   285
  401.                Index           =   2
  402.                Left            =   7320
  403.                TabIndex        =   4
  404.                Top             =   840
  405.                Width           =   1815
  406.             End
  407.             Begin VB.TextBox txtFields 
  408.                Appearance      =   0  'Flat
  409.                DataField       =   "姓名"
  410.                Height          =   285
  411.                Index           =   1
  412.                Left            =   4200
  413.                TabIndex        =   3
  414.                Top             =   840
  415.                Width           =   1815
  416.             End
  417.             Begin VB.TextBox txtFields 
  418.                Appearance      =   0  'Flat
  419.                DataField       =   "员工号"
  420.                Height          =   285
  421.                Index           =   0
  422.                Left            =   1080
  423.                TabIndex        =   2
  424.                Top             =   840
  425.                Width           =   1815
  426.             End
  427.             Begin MSComCtl2.DTPicker DTPicker2 
  428.                DataField       =   "本部门签字时间"
  429.                Height          =   300
  430.                Left            =   1080
  431.                TabIndex        =   15
  432.                Top             =   4800
  433.                Width           =   1815
  434.                _ExtentX        =   3201
  435.                _ExtentY        =   529
  436.                _Version        =   393216
  437.                CheckBox        =   -1  'True
  438.                DateIsNull      =   -1  'True
  439.                Format          =   69795841
  440.                CurrentDate     =   36189
  441.             End
  442.             Begin MSComCtl2.DTPicker DTPicker3 
  443.                DataField       =   "总经理签字时间"
  444.                Height          =   300
  445.                Left            =   7320
  446.                TabIndex        =   17
  447.                Top             =   4800
  448.                Width           =   1815
  449.                _ExtentX        =   3201
  450.                _ExtentY        =   529
  451.                _Version        =   393216
  452.                CheckBox        =   -1  'True
  453.                DateIsNull      =   -1  'True
  454.                Format          =   69795841
  455.                CurrentDate     =   36189
  456.             End
  457.             Begin MSComCtl2.DTPicker DTPicker4 
  458.                DataField       =   "人力资源部签字时间"
  459.                Height          =   300
  460.                Left            =   4440
  461.                TabIndex        =   16
  462.                Top             =   4800
  463.                Width           =   1815
  464.                _ExtentX        =   3201
  465.                _ExtentY        =   529
  466.                _Version        =   393216
  467.                CheckBox        =   -1  'True
  468.                DateIsNull      =   -1  'True
  469.                Format          =   69795841
  470.                CurrentDate     =   36189
  471.             End
  472.             Begin MSComCtl2.DTPicker DTPicker5 
  473.                DataField       =   "出生日期"
  474.                Height          =   300
  475.                Left            =   7320
  476.                TabIndex        =   7
  477.                Top             =   1320
  478.                Width           =   1815
  479.                _ExtentX        =   3201
  480.                _ExtentY        =   529
  481.                _Version        =   393216
  482.                CheckBox        =   -1  'True
  483.                DateIsNull      =   -1  'True
  484.                Format          =   69795841
  485.                CurrentDate     =   36186
  486.             End
  487.             Begin VB.Label Label4 
  488.                Caption         =   "款规定"
  489.                Height          =   375
  490.                Left            =   6360
  491.                TabIndex        =   47
  492.                Top             =   360
  493.                Width           =   1095
  494.             End
  495.             Begin VB.Label Label3 
  496.                Caption         =   "条第"
  497.                Height          =   255
  498.                Left            =   3720
  499.                TabIndex        =   46
  500.                Top             =   360
  501.                Width           =   615
  502.             End
  503.             Begin VB.Label Label2 
  504.                Caption         =   "根据奖惩条例第"
  505.                Height          =   255
  506.                Left            =   240
  507.                TabIndex        =   45
  508.                Top             =   360
  509.                Width           =   1455
  510.             End
  511.             Begin VB.Label lblLabels 
  512.                Caption         =   "本部门经理"
  513.                Height          =   255
  514.                Index           =   10
  515.                Left            =   120
  516.                TabIndex        =   44
  517.                Top             =   4335
  518.                Width           =   1095
  519.             End
  520.             Begin VB.Label lblLabels 
  521.                Caption         =   "签字时间"
  522.                Height          =   255
  523.                Index           =   11
  524.                Left            =   120
  525.                TabIndex        =   43
  526.                Top             =   4823
  527.                Width           =   855
  528.             End
  529.             Begin VB.Label lblLabels 
  530.                Caption         =   "人力资源部经理"
  531.                Height          =   255
  532.                Index           =   12
  533.                Left            =   3000
  534.                TabIndex        =   42
  535.                Top             =   4335
  536.                Width           =   1335
  537.             End
  538.             Begin VB.Label lblLabels 
  539.                Caption         =   "签字时间"
  540.                Height          =   255
  541.                Index           =   13
  542.                Left            =   3000
  543.                TabIndex        =   41
  544.                Top             =   4823
  545.                Width           =   855
  546.             End
  547.             Begin VB.Label lblLabels 
  548.                Caption         =   "总经理"
  549.                Height          =   255
  550.                Index           =   14
  551.                Left            =   6360
  552.                TabIndex        =   40
  553.                Top             =   4335
  554.                Width           =   1095
  555.             End
  556.             Begin VB.Label lblLabels 
  557.                Caption         =   "签字时间"
  558.                Height          =   255
  559.                Index           =   15
  560.                Left            =   6360
  561.                TabIndex        =   39
  562.                Top             =   4823
  563.                Width           =   855
  564.             End
  565.             Begin VB.Label lblLabels 
  566.                Caption         =   "具体内容"
  567.                Height          =   255
  568.                Index           =   8
  569.                Left            =   240
  570.                TabIndex        =   38
  571.                Top             =   2280
  572.                Width           =   855
  573.             End
  574.             Begin VB.Label lblLabels 
  575.                Caption         =   "性  别"
  576.                Height          =   255
  577.                Index           =   7
  578.                Left            =   3240
  579.                TabIndex        =   37
  580.                Top             =   1320
  581.                Width           =   855
  582.             End
  583.             Begin VB.Label Label1 
  584.                Caption         =   "惩罚时间"
  585.                Height          =   255
  586.                Left            =   3240
  587.                TabIndex        =   35
  588.                Top             =   1800
  589.                Width           =   975
  590.             End
  591.             Begin VB.Label lblLabels 
  592.                Caption         =   "说  明"
  593.                Height          =   255
  594.                Index           =   6
  595.                Left            =   240
  596.                TabIndex        =   32
  597.                Top             =   3240
  598.                Width           =   735
  599.             End
  600.             Begin VB.Label lblLabels 
  601.                Caption         =   "惩罚项目"
  602.                Height          =   255
  603.                Index           =   5
  604.                Left            =   240
  605.                TabIndex        =   31
  606.                Top             =   1800
  607.                Width           =   855
  608.             End
  609.             Begin VB.Label lblLabels 
  610.                Caption         =   "出生日期"
  611.                Height          =   255
  612.                Index           =   4
  613.                Left            =   6240
  614.                TabIndex        =   30
  615.                Top             =   1320
  616.                Width           =   855
  617.             End
  618.             Begin VB.Label lblLabels 
  619.                Caption         =   "岗  位"
  620.                Height          =   255
  621.                Index           =   3
  622.                Left            =   240
  623.                TabIndex        =   29
  624.                Top             =   1320
  625.                Width           =   855
  626.             End
  627.             Begin VB.Label lblLabels 
  628.                Caption         =   "部  门"
  629.                Height          =   255
  630.                Index           =   2
  631.                Left            =   6240
  632.                TabIndex        =   28
  633.                Top             =   840
  634.                Width           =   855
  635.             End
  636.             Begin VB.Label lblLabels 
  637.                Caption         =   "姓  名"
  638.                Height          =   255
  639.                Index           =   1
  640.                Left            =   3240
  641.                TabIndex        =   27
  642.                Top             =   840
  643.                Width           =   735
  644.             End
  645.             Begin VB.Label lblLabels 
  646.                Caption         =   "员工号"
  647.                Height          =   255
  648.                Index           =   0
  649.                Left            =   240
  650.                TabIndex        =   26
  651.                Top             =   840
  652.                Width           =   855
  653.             End
  654.          End
  655.       End
  656.    End
  657. End
  658. Attribute VB_Name = "F_ChengFa"
  659. Attribute VB_GlobalNameSpace = False
  660. Attribute VB_Creatable = False
  661. Attribute VB_PredeclaredId = True
  662. Attribute VB_Exposed = False
  663. Dim WithEvents adoPrimaryRS As Recordset
  664. Attribute adoPrimaryRS.VB_VarHelpID = -1
  665. Dim mvBookMark As Variant
  666. Dim mbEditFlag As Boolean
  667. Dim mbAddNewFlag As Boolean
  668. Private Sub Combo1_KeyPress(KeyAscii As Integer)
  669. If KeyAscii = vbKeyReturn Then
  670.     SendKeys "{TAB}"
  671. End If
  672. End Sub
  673. Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
  674. If KeyAscii = vbKeyReturn Then
  675.     SendKeys "{TAB}"
  676. End If
  677. End Sub
  678. Private Sub DTPicker2_KeyPress(KeyAscii As Integer)
  679. If KeyAscii = vbKeyReturn Then
  680.     SendKeys "{TAB}"
  681. End If
  682. End Sub
  683. Private Sub DTPicker3_KeyPress(KeyAscii As Integer)
  684. If KeyAscii = vbKeyReturn Then
  685.     SendKeys "{TAB}"
  686. End If
  687. End Sub
  688. Private Sub DTPicker4_KeyPress(KeyAscii As Integer)
  689. If KeyAscii = vbKeyReturn Then
  690.     SendKeys "{TAB}"
  691. End If
  692. End Sub
  693. Private Sub DTPicker5_KeyPress(KeyAscii As Integer)
  694. If KeyAscii = vbKeyReturn Then
  695.     SendKeys "{TAB}"
  696. End If
  697. End Sub
  698. Private Sub Form_Load()
  699. Dim oText As TextBox
  700. Dim oDTP As DTPicker
  701.   Set adoPrimaryRS = New Recordset
  702.   adoPrimaryRS.Open "select * from 惩罚", db, adOpenStatic, adLockOptimistic
  703.   
  704.   Set DataGrid1.DataSource = adoPrimaryRS
  705.   
  706.   
  707.   SetButtons True
  708.   
  709.   'Bind the text boxes to the data provider
  710.   For Each oText In Me.txtFields
  711.     Set oText.DataSource = adoPrimaryRS
  712.   Next
  713.     
  714.     Set DTPicker1.DataSource = adoPrimaryRS
  715.     Set DTPicker2.DataSource = adoPrimaryRS
  716.     Set DTPicker3.DataSource = adoPrimaryRS
  717.     Set DTPicker4.DataSource = adoPrimaryRS
  718.     Set DTPicker5.DataSource = adoPrimaryRS
  719.     
  720. End Sub
  721. Private Sub Form_Unload(Cancel As Integer)
  722.   Screen.MousePointer = vbDefault
  723. End Sub
  724. Private Sub cmdAdd_Click()
  725.   On Error GoTo AddErr
  726.   With adoPrimaryRS
  727.     If Not (.BOF And .EOF) Then
  728.       mvBookMark = .Bookmark
  729.     End If
  730.     .AddNew
  731.     mbAddNewFlag = True
  732.     SetButtons False
  733.   End With
  734.   On Error GoTo 0
  735.   Exit Sub
  736. AddErr:
  737.   MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
  738.   
  739. End Sub
  740. Private Sub cmdDelete_Click()
  741.   On Error GoTo DeleteErr
  742.   If MsgBox("是否确认删除惩罚信息?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  743.   With adoPrimaryRS
  744.     .Delete
  745.     .MoveNext
  746.     If .EOF Then .MoveLast
  747.   End With
  748.   On Error GoTo 0
  749.   Exit Sub
  750. DeleteErr:
  751.   MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
  752. End Sub
  753. Private Sub cmdRefresh_Click()
  754.   'This is only needed for multi user apps
  755.   On Error GoTo RefreshErr
  756.   adoPrimaryRS.Requery
  757.   Exit Sub
  758. RefreshErr:
  759.    MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
  760. End Sub
  761. Private Sub cmdEdit_Click()
  762.   On Error GoTo EditErr
  763.   mbEditFlag = True
  764.   SetButtons False
  765.   On Error GoTo 0
  766.   Exit Sub
  767. EditErr:
  768.    MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
  769. End Sub
  770. Private Sub cmdCancel_Click()
  771.  ' On Error Resume Next
  772.  On Error GoTo CancelErr
  773.   mbEditFlag = False
  774.   mbAddNewFlag = False
  775.   adoPrimaryRS.CancelUpdate
  776.   If mvBookMark > 0 Then
  777.    adoPrimaryRS.Bookmark = mvBookMark
  778.   Else
  779.    adoPrimaryRS.MoveFirst
  780.   End If
  781.  SetButtons True
  782.   Exit Sub
  783. CancelErr:
  784.    
  785.    MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
  786. End Sub
  787. Private Sub cmdUpdate_Click()
  788.   On Error GoTo UpdateErr
  789.   If MsgBox("是否确认此操作?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  790.   adoPrimaryRS.UpdateBatch adAffectAll
  791.   If mbAddNewFlag Then
  792.     adoPrimaryRS.MoveLast              'move to the new record
  793.   End If
  794.   mbEditFlag = False
  795.   mbAddNewFlag = False
  796.   SetButtons True
  797.   On Error GoTo 0
  798.   Exit Sub
  799. UpdateErr:
  800.    MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
  801. End Sub
  802. Private Sub cmdClose_Click()
  803.   RSGL.Enabled = True
  804.   Unload Me
  805. End Sub
  806. Private Sub SetButtons(bVal As Boolean)
  807. Dim oText As TextBox
  808.  
  809.   CmdAdd.Visible = bVal
  810.   cmdEdit.Visible = bVal
  811.   cmdUpdate.Visible = Not bVal
  812.   cmdCancel.Visible = Not bVal
  813.   CmdDelete.Visible = bVal
  814.   cmdClose.Visible = bVal
  815.   cmdRefresh.Visible = bVal
  816.    
  817.  
  818.   For Each oText In Me.txtFields
  819.      oText.Enabled = Not bVal
  820.   Next
  821.   
  822.   If bVal Then
  823.    Set DataGrid1.DataSource = adoPrimaryRS
  824.   Else
  825.    Set DataGrid1.DataSource = Nothing
  826.   End If
  827.   
  828.   DTPicker1.Enabled = Not bVal
  829.   DTPicker2.Enabled = Not bVal
  830.   DTPicker3.Enabled = Not bVal
  831.   DTPicker4.Enabled = Not bVal
  832.   DTPicker5.Enabled = Not bVal
  833. End Sub
  834. Private Sub txtFields_KeyPress(Index As Integer, KeyAscii As Integer)
  835. If KeyAscii = vbKeyReturn Then
  836.     SendKeys "{TAB}"
  837. End If
  838. End Sub
  839. Private Sub txtFields_LostFocus(Index As Integer)
  840. Dim Sql3 As String
  841.  If Index = 0 Then
  842.  
  843.     Sql3 = "select  distinct 部门 ,姓名 ,性别 ,出生日期 ,岗位   from 员工基本信息  where 员工号 = '" & txtFields(0).Text & "'"
  844.     Set rs3 = db.Execute(Sql3)
  845.    If Not rs3.EOF Then
  846.    
  847.    If Not IsNull(rs3("姓名")) Then
  848.        txtFields(1).Text = Trim(rs3("姓名"))
  849.    End If
  850.    
  851.    If Not IsNull(rs3("部门")) Then
  852.        txtFields(2).Text = Trim(rs3("部门"))
  853.    End If
  854.    
  855.    If Not IsNull(rs3("岗位")) Then
  856.        txtFields(3).Text = Trim(rs3("岗位"))
  857.    End If
  858.    
  859.    If Not IsNull(rs3("性别")) Then
  860.        txtFields(7).Text = Trim(rs3("性别"))
  861.    End If
  862.    
  863.    If Not IsNull(rs3("出生日期")) Then
  864.        DTPicker4.Value = Trim(rs3("出生日期"))
  865.    End If
  866.    
  867.     
  868.   
  869.    End If
  870. End If
  871.    
  872. End Sub