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

企业管理

开发平台:

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