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

企业管理

开发平台:

Visual Basic

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