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

企业管理

开发平台:

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