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

企业管理

开发平台:

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_Mianshi 
  7.    BorderStyle     =   3  'Fixed Dialog
  8.    Caption         =   "面试登记"
  9.    ClientHeight    =   6135
  10.    ClientLeft      =   1095
  11.    ClientTop       =   330
  12.    ClientWidth     =   9765
  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     =   6135
  21.    ScaleWidth      =   9765
  22.    StartUpPosition =   2  '屏幕中心
  23.    Begin VB.Frame Frame1 
  24.       Height          =   5895
  25.       Left            =   120
  26.       TabIndex        =   11
  27.       Top             =   120
  28.       Width           =   9375
  29.       Begin TabDlg.SSTab SSTab1 
  30.          Height          =   5415
  31.          Left            =   240
  32.          TabIndex        =   12
  33.          Top             =   360
  34.          Width           =   9015
  35.          _ExtentX        =   15901
  36.          _ExtentY        =   9551
  37.          _Version        =   393216
  38.          Tabs            =   2
  39.          TabHeight       =   520
  40.          TabCaption(0)   =   "编辑"
  41.          TabPicture(0)   =   "F_Mianshi.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_Mianshi.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          =   420
  59.             Left            =   2280
  60.             ScaleHeight     =   420
  61.             ScaleWidth      =   6480
  62.             TabIndex        =   22
  63.             Top             =   4680
  64.             Width           =   6480
  65.             Begin Threed.SSCommand cmdAdd 
  66.                Height          =   325
  67.                Left            =   480
  68.                TabIndex        =   6
  69.                Top             =   0
  70.                Width           =   1095
  71.                _Version        =   65536
  72.                _ExtentX        =   1931
  73.                _ExtentY        =   573
  74.                _StockProps     =   78
  75.                Caption         =   "&A.增 加"
  76.                Font3D          =   3
  77.             End
  78.             Begin Threed.SSCommand cmdEdit 
  79.                Height          =   325
  80.                Left            =   1680
  81.                TabIndex        =   7
  82.                Top             =   0
  83.                Width           =   1095
  84.                _Version        =   65536
  85.                _ExtentX        =   1931
  86.                _ExtentY        =   573
  87.                _StockProps     =   78
  88.                Caption         =   "&E.编 辑"
  89.                Font3D          =   3
  90.             End
  91.             Begin Threed.SSCommand cmdDelete 
  92.                Height          =   325
  93.                Left            =   2880
  94.                TabIndex        =   8
  95.                Top             =   0
  96.                Width           =   1095
  97.                _Version        =   65536
  98.                _ExtentX        =   1931
  99.                _ExtentY        =   573
  100.                _StockProps     =   78
  101.                Caption         =   "&S.删 除"
  102.                Font3D          =   3
  103.             End
  104.             Begin Threed.SSCommand cmdRefresh 
  105.                Height          =   325
  106.                Left            =   4080
  107.                TabIndex        =   23
  108.                Top             =   0
  109.                Width           =   1095
  110.                _Version        =   65536
  111.                _ExtentX        =   1931
  112.                _ExtentY        =   573
  113.                _StockProps     =   78
  114.                Caption         =   "&R.刷 新"
  115.                Font3D          =   3
  116.             End
  117.             Begin Threed.SSCommand cmdUpdate 
  118.                Height          =   300
  119.                Left            =   4080
  120.                TabIndex        =   9
  121.                Top             =   0
  122.                Width           =   1095
  123.                _Version        =   65536
  124.                _ExtentX        =   1931
  125.                _ExtentY        =   529
  126.                _StockProps     =   78
  127.                Caption         =   "&Y.保存"
  128.                Font3D          =   3
  129.             End
  130.             Begin Threed.SSCommand cmdClose 
  131.                Height          =   325
  132.                Left            =   5280
  133.                TabIndex        =   24
  134.                Top             =   0
  135.                Width           =   1095
  136.                _Version        =   65536
  137.                _ExtentX        =   1931
  138.                _ExtentY        =   573
  139.                _StockProps     =   78
  140.                Caption         =   "&Q.关 闭"
  141.                Font3D          =   3
  142.             End
  143.             Begin Threed.SSCommand cmdCancel 
  144.                Height          =   300
  145.                Left            =   5280
  146.                TabIndex        =   10
  147.                Top             =   0
  148.                Width           =   1095
  149.                _Version        =   65536
  150.                _ExtentX        =   1931
  151.                _ExtentY        =   529
  152.                _StockProps     =   78
  153.                Caption         =   "&C.取消"
  154.                Font3D          =   3
  155.             End
  156.          End
  157.          Begin VB.Frame Frame4 
  158.             Height          =   4815
  159.             Left            =   -74880
  160.             TabIndex        =   19
  161.             Top             =   480
  162.             Width           =   8775
  163.             Begin MSDataGridLib.DataGrid DataGrid1 
  164.                Height          =   4455
  165.                Left            =   120
  166.                TabIndex        =   20
  167.                Top             =   240
  168.                Width           =   8535
  169.                _ExtentX        =   15055
  170.                _ExtentY        =   7858
  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          =   3975
  231.             Left            =   240
  232.             TabIndex        =   13
  233.             Top             =   480
  234.             Width           =   8655
  235.             Begin VB.ComboBox Combo2 
  236.                Appearance      =   0  'Flat
  237.                DataField       =   "岗位名称"
  238.                Height          =   300
  239.                Left            =   5520
  240.                TabIndex        =   3
  241.                Top             =   1560
  242.                Width           =   2415
  243.             End
  244.             Begin VB.ComboBox Combo1 
  245.                Appearance      =   0  'Flat
  246.                DataField       =   "所属部门"
  247.                Height          =   300
  248.                Left            =   1440
  249.                TabIndex        =   2
  250.                Top             =   1560
  251.                Width           =   2415
  252.             End
  253.             Begin VB.TextBox txtFields 
  254.                Appearance      =   0  'Flat
  255.                DataField       =   "招聘编号"
  256.                Height          =   285
  257.                Index           =   0
  258.                Left            =   1440
  259.                TabIndex        =   0
  260.                Top             =   848
  261.                Width           =   2415
  262.             End
  263.             Begin MSComCtl2.DTPicker DTPicker1 
  264.                DataField       =   "面试日期"
  265.                Height          =   300
  266.                Left            =   5520
  267.                TabIndex        =   1
  268.                Top             =   840
  269.                Width           =   2415
  270.                _ExtentX        =   4260
  271.                _ExtentY        =   529
  272.                _Version        =   393216
  273.                CheckBox        =   -1  'True
  274.                DateIsNull      =   -1  'True
  275.                Format          =   127401985
  276.                CurrentDate     =   36191
  277.             End
  278.             Begin VB.TextBox txtFields 
  279.                Appearance      =   0  'Flat
  280.                DataField       =   "面试人数"
  281.                Height          =   285
  282.                Index           =   3
  283.                Left            =   1440
  284.                TabIndex        =   4
  285.                Top             =   2400
  286.                Width           =   2415
  287.             End
  288.             Begin VB.TextBox txtFields 
  289.                Appearance      =   0  'Flat
  290.                DataField       =   "参加人"
  291.                Height          =   285
  292.                Index           =   4
  293.                Left            =   5520
  294.                TabIndex        =   5
  295.                Top             =   2400
  296.                Width           =   2415
  297.             End
  298.             Begin VB.Label lblLabels 
  299.                Caption         =   "招聘编号"
  300.                Height          =   255
  301.                Index           =   5
  302.                Left            =   240
  303.                TabIndex        =   21
  304.                Top             =   863
  305.                Width           =   1815
  306.             End
  307.             Begin VB.Label lblLabels 
  308.                Caption         =   "面试日期"
  309.                Height          =   255
  310.                Index           =   0
  311.                Left            =   4200
  312.                TabIndex        =   18
  313.                Top             =   863
  314.                Width           =   1815
  315.             End
  316.             Begin VB.Label lblLabels 
  317.                Caption         =   "岗位名称"
  318.                Height          =   255
  319.                Index           =   1
  320.                Left            =   4200
  321.                TabIndex        =   17
  322.                Top             =   1583
  323.                Width           =   1815
  324.             End
  325.             Begin VB.Label lblLabels 
  326.                Caption         =   "所属部门"
  327.                Height          =   255
  328.                Index           =   2
  329.                Left            =   240
  330.                TabIndex        =   16
  331.                Top             =   1583
  332.                Width           =   1815
  333.             End
  334.             Begin VB.Label lblLabels 
  335.                Caption         =   "面试人数"
  336.                Height          =   255
  337.                Index           =   3
  338.                Left            =   240
  339.                TabIndex        =   15
  340.                Top             =   2415
  341.                Width           =   1815
  342.             End
  343.             Begin VB.Label lblLabels 
  344.                Caption         =   "参 加 人"
  345.                Height          =   255
  346.                Index           =   4
  347.                Left            =   4200
  348.                TabIndex        =   14
  349.                Top             =   2415
  350.                Width           =   1815
  351.             End
  352.          End
  353.       End
  354.    End
  355. End
  356. Attribute VB_Name = "F_Mianshi"
  357. Attribute VB_GlobalNameSpace = False
  358. Attribute VB_Creatable = False
  359. Attribute VB_PredeclaredId = True
  360. Attribute VB_Exposed = False
  361. Dim WithEvents adoPrimaryRS As Recordset
  362. Attribute adoPrimaryRS.VB_VarHelpID = -1
  363. Dim mvBookMark As Variant
  364. Dim mbEditFlag As Boolean
  365. Dim mbAddNewFlag As Boolean
  366. Private Sub Combo1_Click()
  367. Dim sql2 As String
  368. Combo2.Clear
  369. sql2 = "select  distinct 岗位名称  from 岗位说明  where 所属部门 = '" & Combo1.Text & "'"
  370. Set rs2 = db.Execute(sql2)
  371.    
  372. While Not rs2.EOF
  373.   Combo2.AddItem Trim(rs2("岗位名称"))
  374.    rs2.MoveNext
  375. Wend
  376. End Sub
  377. Private Sub Combo1_KeyPress(KeyAscii As Integer)
  378. If KeyAscii = vbKeyReturn Then
  379.     SendKeys "{TAB}"
  380. End If
  381. End Sub
  382. Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
  383. If KeyAscii = vbKeyReturn Then
  384.     SendKeys "{TAB}"
  385. End If
  386. End Sub
  387. Private Sub Form_Load()
  388. On Error Resume Next
  389.     For Each TextBox In Me.Controls
  390.         TextBox.Font.Name = "宋体"
  391.         TextBox.Font.Size = 9
  392.     Next
  393.  
  394.   Set adoPrimaryRS = New Recordset
  395.   adoPrimaryRS.Open "select * from 面试登记", db, adOpenStatic, adLockOptimistic
  396.   Set DataGrid1.DataSource = adoPrimaryRS
  397.   
  398.   SetButtons True
  399.   Set DTPicker1.DataSource = adoPrimaryRS
  400.   
  401.   Dim oText As TextBox
  402.   'Bind the text boxes to the data provider
  403.   For Each oText In Me.txtFields
  404.     Set oText.DataSource = adoPrimaryRS
  405.   Next
  406.   
  407.   Set Combo1.DataSource = adoPrimaryRS
  408.   Set Combo2.DataSource = adoPrimaryRS
  409.   
  410.   Dim SqlBuMen As String
  411.    SqlBuMen = "select  distinct 部门名称 from 部门维护表"
  412.   Set RsBuMen = db.Execute(SqlBuMen)
  413.    
  414.   While Not RsBuMen.EOF
  415.      Combo1.AddItem Trim(RsBuMen("部门名称"))
  416.     RsBuMen.MoveNext
  417.   Wend
  418. End Sub
  419. Private Sub Form_Unload(Cancel As Integer)
  420.   Screen.MousePointer = vbDefault
  421. End Sub
  422. Private Sub cmdAdd_Click()
  423.   On Error GoTo AddErr
  424.   With adoPrimaryRS
  425.     If Not (.BOF And .EOF) Then
  426.       mvBookMark = .Bookmark
  427.     End If
  428.     .AddNew
  429.     mbAddNewFlag = True
  430.     SetButtons False
  431.   End With
  432.   On Error GoTo 0
  433.   Exit Sub
  434. AddErr:
  435.   MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
  436.   
  437. End Sub
  438. Private Sub cmdDelete_Click()
  439.   On Error GoTo DeleteErr
  440.   If MsgBox("确认删除面试信息吗?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  441.   With adoPrimaryRS
  442.     .Delete
  443.     .MoveNext
  444.     If .EOF Then .MoveLast
  445.   End With
  446.   On Error GoTo 0
  447.   Exit Sub
  448. DeleteErr:
  449.   MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
  450. End Sub
  451. Private Sub cmdRefresh_Click()
  452.   'This is only needed for multi user apps
  453.   On Error GoTo RefreshErr
  454.   adoPrimaryRS.Requery
  455.   On Error GoTo 0
  456.   Exit Sub
  457. RefreshErr:
  458.    MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
  459. End Sub
  460. Private Sub cmdEdit_Click()
  461.   On Error GoTo EditErr
  462.   mbEditFlag = True
  463.   SetButtons False
  464.   On Error GoTo 0
  465.   Exit Sub
  466. EditErr:
  467.    MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
  468. End Sub
  469. Private Sub cmdCancel_Click()
  470.  ' On Error Resume Next
  471.  On Error GoTo CancelErr
  472.   mbEditFlag = False
  473.   mbAddNewFlag = False
  474.   adoPrimaryRS.CancelUpdate
  475.   If mvBookMark > 0 Then
  476.    adoPrimaryRS.Bookmark = mvBookMark
  477.   Else
  478.    adoPrimaryRS.MoveFirst
  479.   End If
  480.  SetButtons True
  481.   Exit Sub
  482. CancelErr:
  483.    
  484.    MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
  485. End Sub
  486. Private Sub cmdUpdate_Click()
  487.   On Error GoTo UpdateErr
  488.   If MsgBox("是否确认此操作?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  489.   adoPrimaryRS.UpdateBatch adAffectAll
  490.   If mbAddNewFlag Then
  491.     adoPrimaryRS.MoveLast              'move to the new record
  492.   End If
  493.   mbEditFlag = False
  494.   mbAddNewFlag = False
  495.   SetButtons True
  496.   On Error GoTo 0
  497.   Exit Sub
  498. UpdateErr:
  499.    MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
  500. End Sub
  501. Private Sub cmdClose_Click()
  502.   RSGL.Enabled = True
  503.   Unload Me
  504. End Sub
  505. Private Sub SetButtons(bVal As Boolean)
  506. Dim oTEX As TextBox
  507.   CmdAdd.Visible = bVal
  508.   cmdEdit.Visible = bVal
  509.   cmdUpdate.Visible = Not bVal
  510.   cmdCancel.Visible = Not bVal
  511.   CmdDelete.Visible = bVal
  512.   cmdClose.Visible = bVal
  513.   cmdRefresh.Visible = bVal
  514.   If bVal Then
  515.    Set DataGrid1.DataSource = adoPrimaryRS
  516.   Else
  517.    Set DataGrid1.DataSource = Nothing
  518.   End If
  519.   
  520.   For Each oText In Me.txtFields
  521.      oText.Enabled = Not bVal
  522.   Next
  523.   
  524.   DTPicker1.Enabled = Not bVal
  525.   Combo1.Enabled = Not bVal
  526.   Combo2.Enabled = Not bVal
  527. End Sub
  528. Private Sub txtFields_KeyPress(Index As Integer, KeyAscii As Integer)
  529. If KeyAscii = vbKeyReturn Then
  530.     SendKeys "{TAB}"
  531. End If
  532. End Sub
  533. Private Sub txtFields_LostFocus(Index As Integer)
  534. If Not IsNumeric(txtFields(3).Text) And (txtFields(3).Text <> "") Then
  535.     MsgBox "请在“面试人数”中输入数字", vbExclamation + vbOKOnly, pTitle
  536.      txtFields(3).SetFocus
  537.      txtFields(3).SelLength = Len(txtFields(3))
  538.      txtFields(3).SelStart = 0
  539. End If
  540. End Sub