main_jbzl_jsr.frm
上传用户:ake0106
上传日期:2022-07-23
资源大小:4052k
文件大小:25k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
  4. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  5. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  6. Begin VB.Form main_jbzl_jsr 
  7.    BorderStyle     =   3  'Fixed Dialog
  8.    Caption         =   "Form1"
  9.    ClientHeight    =   4680
  10.    ClientLeft      =   45
  11.    ClientTop       =   330
  12.    ClientWidth     =   8595
  13.    Icon            =   "main_jbzl_jsr.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   4680
  18.    ScaleWidth      =   8595
  19.    ShowInTaskbar   =   0   'False
  20.    StartUpPosition =   2  '屏幕中心
  21.    Begin MSAdodcLib.Adodc Adodc1 
  22.       Height          =   330
  23.       Left            =   15
  24.       Top             =   3120
  25.       Visible         =   0   'False
  26.       Width           =   2040
  27.       _ExtentX        =   3598
  28.       _ExtentY        =   582
  29.       ConnectMode     =   0
  30.       CursorLocation  =   3
  31.       IsolationLevel  =   -1
  32.       ConnectionTimeout=   15
  33.       CommandTimeout  =   30
  34.       CursorType      =   3
  35.       LockType        =   3
  36.       CommandType     =   2
  37.       CursorOptions   =   0
  38.       CacheSize       =   50
  39.       MaxRecords      =   0
  40.       BOFAction       =   0
  41.       EOFAction       =   0
  42.       ConnectStringType=   1
  43.       Appearance      =   1
  44.       BackColor       =   -2147483643
  45.       ForeColor       =   -2147483640
  46.       Orientation     =   0
  47.       Enabled         =   -1
  48.       Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  49.       OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  50.       OLEDBFile       =   ""
  51.       DataSourceName  =   ""
  52.       OtherAttributes =   ""
  53.       UserName        =   ""
  54.       Password        =   ""
  55.       RecordSource    =   "培训课程表"
  56.       Caption         =   "Adodc1"
  57.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  58.          Name            =   "宋体"
  59.          Size            =   9
  60.          Charset         =   134
  61.          Weight          =   400
  62.          Underline       =   0   'False
  63.          Italic          =   0   'False
  64.          Strikethrough   =   0   'False
  65.       EndProperty
  66.       _Version        =   393216
  67.    End
  68.    Begin MSDataGridLib.DataGrid DataGrid1 
  69.       Bindings        =   "main_jbzl_jsr.frx":000C
  70.       Height          =   1800
  71.       Left            =   30
  72.       TabIndex        =   5
  73.       Top             =   2865
  74.       Width           =   8160
  75.       _ExtentX        =   14393
  76.       _ExtentY        =   3175
  77.       _Version        =   393216
  78.       AllowUpdate     =   0   'False
  79.       HeadLines       =   1
  80.       RowHeight       =   15
  81.       FormatLocked    =   -1  'True
  82.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  83.          Name            =   "宋体"
  84.          Size            =   9
  85.          Charset         =   134
  86.          Weight          =   400
  87.          Underline       =   0   'False
  88.          Italic          =   0   'False
  89.          Strikethrough   =   0   'False
  90.       EndProperty
  91.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  92.          Name            =   "宋体"
  93.          Size            =   9
  94.          Charset         =   134
  95.          Weight          =   400
  96.          Underline       =   0   'False
  97.          Italic          =   0   'False
  98.          Strikethrough   =   0   'False
  99.       EndProperty
  100.       ColumnCount     =   11
  101.       BeginProperty Column00 
  102.          DataField       =   "课程编号"
  103.          Caption         =   "课程编号"
  104.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  105.             Type            =   0
  106.             Format          =   ""
  107.             HaveTrueFalseNull=   0
  108.             FirstDayOfWeek  =   0
  109.             FirstWeekOfYear =   0
  110.             LCID            =   2052
  111.             SubFormatType   =   0
  112.          EndProperty
  113.       EndProperty
  114.       BeginProperty Column01 
  115.          DataField       =   "课程名称"
  116.          Caption         =   "课程名称"
  117.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  118.             Type            =   0
  119.             Format          =   ""
  120.             HaveTrueFalseNull=   0
  121.             FirstDayOfWeek  =   0
  122.             FirstWeekOfYear =   0
  123.             LCID            =   2052
  124.             SubFormatType   =   0
  125.          EndProperty
  126.       EndProperty
  127.       BeginProperty Column02 
  128.          DataField       =   "主办单位"
  129.          Caption         =   "主办单位"
  130.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  131.             Type            =   0
  132.             Format          =   ""
  133.             HaveTrueFalseNull=   0
  134.             FirstDayOfWeek  =   0
  135.             FirstWeekOfYear =   0
  136.             LCID            =   2052
  137.             SubFormatType   =   0
  138.          EndProperty
  139.       EndProperty
  140.       BeginProperty Column03 
  141.          DataField       =   "培训方式"
  142.          Caption         =   "培训方式"
  143.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  144.             Type            =   0
  145.             Format          =   ""
  146.             HaveTrueFalseNull=   0
  147.             FirstDayOfWeek  =   0
  148.             FirstWeekOfYear =   0
  149.             LCID            =   2052
  150.             SubFormatType   =   0
  151.          EndProperty
  152.       EndProperty
  153.       BeginProperty Column04 
  154.          DataField       =   "授课对象"
  155.          Caption         =   "授课对象"
  156.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  157.             Type            =   0
  158.             Format          =   ""
  159.             HaveTrueFalseNull=   0
  160.             FirstDayOfWeek  =   0
  161.             FirstWeekOfYear =   0
  162.             LCID            =   2052
  163.             SubFormatType   =   0
  164.          EndProperty
  165.       EndProperty
  166.       BeginProperty Column05 
  167.          DataField       =   "授课方式"
  168.          Caption         =   "授课方式"
  169.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  170.             Type            =   0
  171.             Format          =   ""
  172.             HaveTrueFalseNull=   0
  173.             FirstDayOfWeek  =   0
  174.             FirstWeekOfYear =   0
  175.             LCID            =   2052
  176.             SubFormatType   =   0
  177.          EndProperty
  178.       EndProperty
  179.       BeginProperty Column06 
  180.          DataField       =   "是否认证"
  181.          Caption         =   "是否认证"
  182.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  183.             Type            =   0
  184.             Format          =   ""
  185.             HaveTrueFalseNull=   0
  186.             FirstDayOfWeek  =   0
  187.             FirstWeekOfYear =   0
  188.             LCID            =   2052
  189.             SubFormatType   =   0
  190.          EndProperty
  191.       EndProperty
  192.       BeginProperty Column07 
  193.          DataField       =   "授课时数"
  194.          Caption         =   "授课时数"
  195.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  196.             Type            =   0
  197.             Format          =   ""
  198.             HaveTrueFalseNull=   0
  199.             FirstDayOfWeek  =   0
  200.             FirstWeekOfYear =   0
  201.             LCID            =   2052
  202.             SubFormatType   =   0
  203.          EndProperty
  204.       EndProperty
  205.       BeginProperty Column08 
  206.          DataField       =   "费用"
  207.          Caption         =   "费用"
  208.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  209.             Type            =   0
  210.             Format          =   ""
  211.             HaveTrueFalseNull=   0
  212.             FirstDayOfWeek  =   0
  213.             FirstWeekOfYear =   0
  214.             LCID            =   2052
  215.             SubFormatType   =   0
  216.          EndProperty
  217.       EndProperty
  218.       BeginProperty Column09 
  219.          DataField       =   "开课时间"
  220.          Caption         =   "开课时间"
  221.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  222.             Type            =   0
  223.             Format          =   ""
  224.             HaveTrueFalseNull=   0
  225.             FirstDayOfWeek  =   0
  226.             FirstWeekOfYear =   0
  227.             LCID            =   2052
  228.             SubFormatType   =   0
  229.          EndProperty
  230.       EndProperty
  231.       BeginProperty Column10 
  232.          DataField       =   "结束时间"
  233.          Caption         =   "结束时间"
  234.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  235.             Type            =   0
  236.             Format          =   ""
  237.             HaveTrueFalseNull=   0
  238.             FirstDayOfWeek  =   0
  239.             FirstWeekOfYear =   0
  240.             LCID            =   2052
  241.             SubFormatType   =   0
  242.          EndProperty
  243.       EndProperty
  244.       SplitCount      =   1
  245.       BeginProperty Split0 
  246.          MarqueeStyle    =   4
  247.          BeginProperty Column00 
  248.             ColumnWidth     =   794.835
  249.          EndProperty
  250.          BeginProperty Column01 
  251.             ColumnWidth     =   1709.858
  252.          EndProperty
  253.          BeginProperty Column02 
  254.             ColumnWidth     =   2085.166
  255.          EndProperty
  256.          BeginProperty Column03 
  257.             ColumnWidth     =   810.142
  258.          EndProperty
  259.          BeginProperty Column04 
  260.             ColumnWidth     =   2085.166
  261.          EndProperty
  262.          BeginProperty Column05 
  263.             ColumnWidth     =   1110.047
  264.          EndProperty
  265.          BeginProperty Column06 
  266.             ColumnWidth     =   794.835
  267.          EndProperty
  268.          BeginProperty Column07 
  269.             ColumnWidth     =   780.095
  270.          EndProperty
  271.          BeginProperty Column08 
  272.             ColumnWidth     =   915.024
  273.          EndProperty
  274.          BeginProperty Column09 
  275.             ColumnWidth     =   2085.166
  276.          EndProperty
  277.          BeginProperty Column10 
  278.             ColumnWidth     =   2085.166
  279.          EndProperty
  280.       EndProperty
  281.    End
  282.    Begin MSComctlLib.ImageList ImageList1 
  283.       Left            =   -225
  284.       Top             =   2550
  285.       _ExtentX        =   1005
  286.       _ExtentY        =   1005
  287.       BackColor       =   -2147483643
  288.       ImageWidth      =   32
  289.       ImageHeight     =   32
  290.       MaskColor       =   12632256
  291.       _Version        =   393216
  292.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  293.          NumListImages   =   7
  294.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  295.             Picture         =   "main_jbzl_jsr.frx":0021
  296.             Key             =   ""
  297.          EndProperty
  298.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  299.             Picture         =   "main_jbzl_jsr.frx":08FB
  300.             Key             =   ""
  301.          EndProperty
  302.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  303.             Picture         =   "main_jbzl_jsr.frx":11D5
  304.             Key             =   ""
  305.          EndProperty
  306.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  307.             Picture         =   "main_jbzl_jsr.frx":1AAF
  308.             Key             =   ""
  309.          EndProperty
  310.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  311.             Picture         =   "main_jbzl_jsr.frx":2389
  312.             Key             =   ""
  313.          EndProperty
  314.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  315.             Picture         =   "main_jbzl_jsr.frx":2C63
  316.             Key             =   ""
  317.          EndProperty
  318.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  319.             Picture         =   "main_jbzl_jsr.frx":353D
  320.             Key             =   ""
  321.          EndProperty
  322.       EndProperty
  323.    End
  324.    Begin MSComctlLib.Toolbar Toolbar1 
  325.       Align           =   1  'Align Top
  326.       Height          =   795
  327.       Left            =   0
  328.       TabIndex        =   0
  329.       Top             =   0
  330.       Width           =   8595
  331.       _ExtentX        =   15161
  332.       _ExtentY        =   1402
  333.       ButtonWidth     =   1138
  334.       ButtonHeight    =   1349
  335.       Appearance      =   1
  336.       Style           =   1
  337.       ImageList       =   "ImageList1"
  338.       _Version        =   393216
  339.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  340.          NumButtons      =   12
  341.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  342.             Caption         =   " 增加 "
  343.             Key             =   "add"
  344.             ImageIndex      =   1
  345.          EndProperty
  346.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  347.             Caption         =   "修改"
  348.             Key             =   "modify"
  349.             ImageIndex      =   2
  350.          EndProperty
  351.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  352.             Caption         =   "删除"
  353.             Key             =   "delete"
  354.             ImageIndex      =   3
  355.          EndProperty
  356.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  357.             Caption         =   "保存"
  358.             Key             =   "save"
  359.             ImageIndex      =   4
  360.          EndProperty
  361.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  362.             Caption         =   "取消"
  363.             Key             =   "cancel"
  364.             ImageIndex      =   5
  365.          EndProperty
  366.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  367.             Caption         =   "查找"
  368.             Key             =   "find"
  369.             ImageIndex      =   6
  370.          EndProperty
  371.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  372.             Enabled         =   0   'False
  373.          EndProperty
  374.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  375.             Enabled         =   0   'False
  376.          EndProperty
  377.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  378.             Enabled         =   0   'False
  379.          EndProperty
  380.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  381.             Enabled         =   0   'False
  382.          EndProperty
  383.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  384.             Enabled         =   0   'False
  385.             Style           =   3
  386.          EndProperty
  387.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  388.             Caption         =   "关闭"
  389.             Key             =   "close"
  390.             ImageIndex      =   7
  391.          EndProperty
  392.       EndProperty
  393.       BorderStyle     =   1
  394.    End
  395.    Begin VB.Frame Frame1 
  396.       Height          =   2055
  397.       Left            =   15
  398.       TabIndex        =   1
  399.       Top             =   765
  400.       Width           =   8175
  401.       Begin MSComCtl2.DTPicker DTPicker2 
  402.          Height          =   330
  403.          Left            =   5040
  404.          TabIndex        =   24
  405.          Top             =   1635
  406.          Width           =   3060
  407.          _ExtentX        =   5398
  408.          _ExtentY        =   582
  409.          _Version        =   393216
  410.          Format          =   19791873
  411.          CurrentDate     =   38695
  412.       End
  413.       Begin MSComCtl2.DTPicker DTPicker1 
  414.          Height          =   330
  415.          Left            =   1050
  416.          TabIndex        =   22
  417.          Top             =   1620
  418.          Width           =   3060
  419.          _ExtentX        =   5398
  420.          _ExtentY        =   582
  421.          _Version        =   393216
  422.          Format          =   19791873
  423.          CurrentDate     =   38695
  424.       End
  425.       Begin VB.CheckBox Check1 
  426.          Caption         =   "是"
  427.          Height          =   180
  428.          Left            =   1080
  429.          TabIndex        =   19
  430.          Top             =   1335
  431.          Width           =   480
  432.       End
  433.       Begin VB.ComboBox Combo2 
  434.          Height          =   300
  435.          Left            =   5325
  436.          TabIndex        =   17
  437.          Text            =   "Combo1"
  438.          Top             =   930
  439.          Width           =   2775
  440.       End
  441.       Begin VB.ComboBox Combo1 
  442.          Height          =   300
  443.          Left            =   5325
  444.          TabIndex        =   15
  445.          Text            =   "Combo1"
  446.          Top             =   555
  447.          Width           =   2775
  448.       End
  449.       Begin VB.TextBox Text1 
  450.          Height          =   330
  451.          Index           =   4
  452.          Left            =   2340
  453.          Locked          =   -1  'True
  454.          TabIndex        =   12
  455.          Top             =   1245
  456.          Width           =   2055
  457.       End
  458.       Begin VB.TextBox Text1 
  459.          Height          =   330
  460.          Index           =   5
  461.          Left            =   5325
  462.          Locked          =   -1  'True
  463.          TabIndex        =   11
  464.          Top             =   1260
  465.          Width           =   2775
  466.       End
  467.       Begin VB.TextBox Text1 
  468.          Height          =   330
  469.          Index           =   3
  470.          Left            =   915
  471.          Locked          =   -1  'True
  472.          TabIndex        =   8
  473.          Top             =   885
  474.          Width           =   3480
  475.       End
  476.       Begin VB.TextBox Text1 
  477.          Height          =   330
  478.          Index           =   2
  479.          Left            =   915
  480.          Locked          =   -1  'True
  481.          TabIndex        =   7
  482.          Top             =   525
  483.          Width           =   3480
  484.       End
  485.       Begin VB.TextBox Text1 
  486.          Height          =   330
  487.          Index           =   1
  488.          Left            =   3300
  489.          Locked          =   -1  'True
  490.          TabIndex        =   4
  491.          Top             =   150
  492.          Width           =   4815
  493.       End
  494.       Begin VB.TextBox Text1 
  495.          Height          =   330
  496.          Index           =   0
  497.          Left            =   915
  498.          Locked          =   -1  'True
  499.          TabIndex        =   3
  500.          Top             =   150
  501.          Width           =   1530
  502.       End
  503.       Begin VB.Label Label11 
  504.          Caption         =   "结束时间"
  505.          Height          =   195
  506.          Left            =   4230
  507.          TabIndex        =   23
  508.          Top             =   1710
  509.          Width           =   765
  510.       End
  511.       Begin VB.Label Label10 
  512.          Caption         =   "开课时间"
  513.          Height          =   195
  514.          Left            =   165
  515.          TabIndex        =   21
  516.          Top             =   1695
  517.          Width           =   765
  518.       End
  519.       Begin VB.Label Label9 
  520.          Caption         =   "费用"
  521.          Height          =   165
  522.          Left            =   4860
  523.          TabIndex        =   20
  524.          Top             =   1365
  525.          Width           =   360
  526.       End
  527.       Begin VB.Label Label8 
  528.          Caption         =   "是否认证"
  529.          Height          =   225
  530.          Left            =   120
  531.          TabIndex        =   18
  532.          Top             =   1335
  533.          Width           =   795
  534.       End
  535.       Begin VB.Label Label7 
  536.          Caption         =   "授课方式"
  537.          Height          =   165
  538.          Left            =   4485
  539.          TabIndex        =   16
  540.          Top             =   960
  541.          Width           =   735
  542.       End
  543.       Begin VB.Label Label6 
  544.          Caption         =   "授课对象"
  545.          Height          =   165
  546.          Left            =   120
  547.          TabIndex        =   14
  548.          Top             =   990
  549.          Width           =   750
  550.       End
  551.       Begin VB.Label Label5 
  552.          Caption         =   "时数"
  553.          Height          =   165
  554.          Left            =   1890
  555.          TabIndex        =   13
  556.          Top             =   1350
  557.          Width           =   465
  558.       End
  559.       Begin VB.Label Label4 
  560.          Caption         =   "主办单位"
  561.          Height          =   165
  562.          Left            =   105
  563.          TabIndex        =   10
  564.          Top             =   600
  565.          Width           =   795
  566.       End
  567.       Begin VB.Label Label3 
  568.          Caption         =   "培训方式"
  569.          Height          =   165
  570.          Left            =   4515
  571.          TabIndex        =   9
  572.          Top             =   585
  573.          Width           =   735
  574.       End
  575.       Begin VB.Label Label2 
  576.          Caption         =   "课程名称"
  577.          ForeColor       =   &H000000FF&
  578.          Height          =   165
  579.          Left            =   2520
  580.          TabIndex        =   6
  581.          Top             =   225
  582.          Width           =   975
  583.       End
  584.       Begin VB.Label Label1 
  585.          Caption         =   "课程编号"
  586.          ForeColor       =   &H000000FF&
  587.          Height          =   165
  588.          Left            =   120
  589.          TabIndex        =   2
  590.          Top             =   240
  591.          Width           =   945
  592.       End
  593.    End
  594. End
  595. Attribute VB_Name = "main_jbzl_jsr"
  596. Attribute VB_GlobalNameSpace = False
  597. Attribute VB_Creatable = False
  598. Attribute VB_PredeclaredId = True
  599. Attribute VB_Exposed = False
  600. Dim rs1 As New ADODB.Recordset
  601. Public blnAdd As Boolean
  602. Dim mybookmark
  603. Sub view_data()
  604.   Dim i As Integer
  605.   If Adodc1.Recordset.RecordCount > 0 Then
  606.   For i = 0 To Text1.UBound
  607.     Text1(i) = DataGrid1.Columns(i).text
  608.   Next i
  609.   End If
  610. End Sub
  611. Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  612.   view_data
  613. End Sub
  614. Private Sub Form_Activate()
  615.   If sql <> "" Then
  616.      Adodc1.RecordSource = sql
  617.      Adodc1.Refresh
  618.      If Adodc1.Recordset.RecordCount > 0 Then
  619.         view_data
  620.      Else
  621.         MsgBox "没有找到符合条件的记录!", , "提示窗口"
  622.      End If
  623.   End If
  624. End Sub
  625. Private Sub Form_Load()
  626.   Me.Caption = text
  627.   tlbState Toolbar1, False
  628. End Sub
  629. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  630.   sql = ""
  631. End Sub
  632. Private Sub Text1_GotFocus(Index As Integer)
  633.   Text1(Index).BackColor = &HFFFF00
  634.   Text1(Index).SelStart = 0
  635.   Text1(Index).SelLength = Len(Text1(Index))
  636. End Sub
  637. Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
  638.   If KeyCode = vbKeyReturn And Index < 5 Then Text1(Index + 1).SetFocus
  639. End Sub
  640. Private Sub Text1_LostFocus(Index As Integer)
  641.   Text1(Index).BackColor = &H80000005
  642. End Sub
  643. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  644.   Select Case Button.Key
  645.      Case "add"
  646.        blnAdd = True
  647.        tlbState Toolbar1, True
  648.        rs1.Open "select * from tb_jsr", Cnn, adOpenStatic
  649.        If rs1.RecordCount > 0 Then
  650.           rs1.MoveLast
  651.           Text1(0) = Format(Val(rs1.Fields("课程编号")) + 1, "00")
  652.        Else
  653.           Text1(0) = "01"
  654.        End If
  655.        rs1.Close
  656.        For i = 1 To Text1.UBound
  657.            Text1(i) = ""
  658.            Text1(i).Locked = False
  659.        Next i
  660.        Text1(1).SetFocus
  661.      Case "modify"
  662.        If Adodc1.Recordset.RecordCount > 0 Then
  663.          blnAdd = False
  664.          tlbState Toolbar1, True
  665.          For i = 1 To Text1.UBound
  666.              Text1(i).Locked = False
  667.          Next i
  668.          view_data
  669.          mybookmark = DataGrid1.Bookmark
  670.        Else
  671.          MsgBox "系统没有要修改的数据!", , "提示窗口"
  672.        End If
  673.      Case "delete"
  674.        If Adodc1.Recordset.RecordCount > 0 Then
  675.          Adodc1.Recordset.Delete
  676.          Adodc1.Refresh
  677.        Else
  678.          MsgBox "系统没有要删除的数据!", , "提示窗口"
  679.        End If
  680.      Case "save"
  681.        On Error GoTo SaveErr
  682.        If Text1(0).text = "" Then
  683.           MsgBox "系统不允许" & Label1 & "为空!", , "提示窗口"
  684.           Exit Sub
  685.        End If
  686.         If blnAdd = True Then
  687.           Cnn.Execute ("insert into 培训课程表(课程编号,课程名称,主办单位,培训方式,授课对象,授课方式,是否认证,授课时数,费用,开课时间,结束时间) values('" + Text1(0) + _
  688.           "','" + Text1(1) + "','" + Text1(2) + "','" + Combo1 + "','" + Text1(3) + "','" + combo4 + "','" + Check1.Value + "'," + Text1(4) + ",'" + Str(DTPicker1) + "','" + Str(DTPicker2) + "')")
  689.           Adodc1.Refresh
  690.           tlbState Toolbar1, False
  691.           For i = 1 To Text1.UBound
  692.             Text1(i).Locked = True
  693.           Next i
  694.         Else
  695.           Cnn.Execute ("update tb_jsr set 经手人姓名 ='" + Text1(1) + "',联系方式 ='" + Text1(2) + _
  696.           "',联系地址 ='" + Text1(3) + "',身份证号 ='" + Text1(4) + "',备注='" + Text1(5) + _
  697.           "',修改人='" + czy + "',修改日期='" + Str(Date) + "'where 经手人编号='" + DataGrid1.Columns(0) + "'")
  698.           Adodc1.Refresh
  699.           DataGrid1.Bookmark = mybookmark
  700.           view_data
  701.           tlbState Toolbar1, False
  702.           For i = 1 To Text1.UBound
  703.             Text1(i).Locked = True
  704.           Next i
  705.         End If
  706.         Exit Sub
  707. SaveErr:
  708.         MsgBox Err.Description
  709.      Case "cancel"
  710.        tlbState Toolbar1, False
  711.        For i = 1 To Text1.UBound
  712.            Text1(i).Locked = True
  713.        Next i
  714.      Case "find"
  715.        tb = "tb_jsr"
  716.        Load main_find
  717.        main_find.Show 1
  718.      Case "close"
  719.        Unload Me
  720.   End Select
  721. End Sub