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

企业管理

开发平台:

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_pxkc 
  7.    BorderStyle     =   3  'Fixed Dialog
  8.    Caption         =   "Form1"
  9.    ClientHeight    =   4680
  10.    ClientLeft      =   45
  11.    ClientTop       =   330
  12.    ClientWidth     =   8235
  13.    Icon            =   "main_jbzl_pxkc.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   4680
  18.    ScaleWidth      =   8235
  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_pxkc.frx":000C
  70.       Height          =   1800
  71.       Left            =   30
  72.       TabIndex        =   4
  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            =   1
  223.             Format          =   "yyyy-MM-dd"
  224.             HaveTrueFalseNull=   0
  225.             FirstDayOfWeek  =   0
  226.             FirstWeekOfYear =   0
  227.             LCID            =   2052
  228.             SubFormatType   =   3
  229.          EndProperty
  230.       EndProperty
  231.       BeginProperty Column10 
  232.          DataField       =   "结束时间"
  233.          Caption         =   "结束时间"
  234.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  235.             Type            =   1
  236.             Format          =   "yyyy-MM-dd"
  237.             HaveTrueFalseNull=   0
  238.             FirstDayOfWeek  =   0
  239.             FirstWeekOfYear =   0
  240.             LCID            =   2052
  241.             SubFormatType   =   3
  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            =   0
  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   =   8
  294.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  295.             Picture         =   "main_jbzl_pxkc.frx":0021
  296.             Key             =   ""
  297.          EndProperty
  298.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  299.             Picture         =   "main_jbzl_pxkc.frx":08FB
  300.             Key             =   ""
  301.          EndProperty
  302.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  303.             Picture         =   "main_jbzl_pxkc.frx":11D5
  304.             Key             =   ""
  305.          EndProperty
  306.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  307.             Picture         =   "main_jbzl_pxkc.frx":1AAF
  308.             Key             =   ""
  309.          EndProperty
  310.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  311.             Picture         =   "main_jbzl_pxkc.frx":2789
  312.             Key             =   ""
  313.          EndProperty
  314.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  315.             Picture         =   "main_jbzl_pxkc.frx":3063
  316.             Key             =   ""
  317.          EndProperty
  318.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  319.             Picture         =   "main_jbzl_pxkc.frx":37DD
  320.             Key             =   ""
  321.          EndProperty
  322.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  323.             Picture         =   "main_jbzl_pxkc.frx":44B7
  324.             Key             =   ""
  325.          EndProperty
  326.       EndProperty
  327.    End
  328.    Begin MSComctlLib.Toolbar Toolbar1 
  329.       Align           =   1  'Align Top
  330.       Height          =   795
  331.       Left            =   0
  332.       TabIndex        =   24
  333.       Top             =   0
  334.       Width           =   8235
  335.       _ExtentX        =   14526
  336.       _ExtentY        =   1402
  337.       ButtonWidth     =   1138
  338.       ButtonHeight    =   1349
  339.       Appearance      =   1
  340.       Style           =   1
  341.       ImageList       =   "ImageList1"
  342.       _Version        =   393216
  343.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  344.          NumButtons      =   11
  345.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  346.             Caption         =   " 增加 "
  347.             Key             =   "add"
  348.             ImageIndex      =   1
  349.          EndProperty
  350.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  351.             Caption         =   "修改"
  352.             Key             =   "modify"
  353.             ImageIndex      =   2
  354.          EndProperty
  355.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  356.             Caption         =   "删除"
  357.             Key             =   "delete"
  358.             ImageIndex      =   3
  359.          EndProperty
  360.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  361.             Style           =   3
  362.          EndProperty
  363.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  364.             Caption         =   "保存"
  365.             Key             =   "save"
  366.             ImageIndex      =   4
  367.          EndProperty
  368.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  369.             Caption         =   "取消"
  370.             Key             =   "cancel"
  371.             ImageIndex      =   5
  372.          EndProperty
  373.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  374.             Style           =   3
  375.          EndProperty
  376.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  377.             Caption         =   "查找"
  378.             Key             =   "find"
  379.             ImageIndex      =   6
  380.          EndProperty
  381.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  382.             Caption         =   "全部"
  383.             Key             =   "all"
  384.             ImageIndex      =   7
  385.          EndProperty
  386.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  387.             Style           =   3
  388.          EndProperty
  389.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  390.             Caption         =   "关闭"
  391.             Key             =   "close"
  392.             ImageIndex      =   8
  393.          EndProperty
  394.       EndProperty
  395.       BorderStyle     =   1
  396.    End
  397.    Begin VB.Frame Frame1 
  398.       Height          =   2055
  399.       Left            =   15
  400.       TabIndex        =   0
  401.       Top             =   765
  402.       Width           =   8175
  403.       Begin MSComCtl2.DTPicker DTPicker2 
  404.          Height          =   330
  405.          Left            =   5040
  406.          TabIndex        =   23
  407.          Top             =   1635
  408.          Width           =   3060
  409.          _ExtentX        =   5398
  410.          _ExtentY        =   582
  411.          _Version        =   393216
  412.          Format          =   48365569
  413.          CurrentDate     =   38695
  414.       End
  415.       Begin MSComCtl2.DTPicker DTPicker1 
  416.          Height          =   330
  417.          Left            =   1050
  418.          TabIndex        =   21
  419.          Top             =   1620
  420.          Width           =   3060
  421.          _ExtentX        =   5398
  422.          _ExtentY        =   582
  423.          _Version        =   393216
  424.          Format          =   48365569
  425.          CurrentDate     =   38695
  426.       End
  427.       Begin VB.CheckBox Check1 
  428.          Caption         =   "是"
  429.          Height          =   180
  430.          Left            =   1080
  431.          TabIndex        =   18
  432.          Top             =   1335
  433.          Width           =   480
  434.       End
  435.       Begin VB.ComboBox Combo2 
  436.          Height          =   300
  437.          Left            =   5325
  438.          TabIndex        =   16
  439.          Top             =   930
  440.          Width           =   2775
  441.       End
  442.       Begin VB.ComboBox Combo1 
  443.          Height          =   300
  444.          Left            =   5325
  445.          TabIndex        =   14
  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        =   11
  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        =   10
  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        =   7
  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        =   6
  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        =   3
  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        =   2
  500.          Top             =   150
  501.          Width           =   1530
  502.       End
  503.       Begin VB.Label Label11 
  504.          Caption         =   "结束时间"
  505.          Height          =   195
  506.          Left            =   4230
  507.          TabIndex        =   22
  508.          Top             =   1710
  509.          Width           =   765
  510.       End
  511.       Begin VB.Label Label10 
  512.          Caption         =   "开课时间"
  513.          Height          =   195
  514.          Left            =   165
  515.          TabIndex        =   20
  516.          Top             =   1695
  517.          Width           =   765
  518.       End
  519.       Begin VB.Label Label9 
  520.          Caption         =   "费用"
  521.          Height          =   165
  522.          Left            =   4860
  523.          TabIndex        =   19
  524.          Top             =   1365
  525.          Width           =   360
  526.       End
  527.       Begin VB.Label Label8 
  528.          Caption         =   "是否认证"
  529.          Height          =   225
  530.          Left            =   120
  531.          TabIndex        =   17
  532.          Top             =   1335
  533.          Width           =   795
  534.       End
  535.       Begin VB.Label Label7 
  536.          Caption         =   "授课方式"
  537.          Height          =   165
  538.          Left            =   4485
  539.          TabIndex        =   15
  540.          Top             =   960
  541.          Width           =   735
  542.       End
  543.       Begin VB.Label Label6 
  544.          Caption         =   "授课对象"
  545.          Height          =   165
  546.          Left            =   120
  547.          TabIndex        =   13
  548.          Top             =   990
  549.          Width           =   750
  550.       End
  551.       Begin VB.Label Label5 
  552.          Caption         =   "时数"
  553.          Height          =   165
  554.          Left            =   1890
  555.          TabIndex        =   12
  556.          Top             =   1350
  557.          Width           =   465
  558.       End
  559.       Begin VB.Label Label4 
  560.          Caption         =   "主办单位"
  561.          Height          =   165
  562.          Left            =   105
  563.          TabIndex        =   9
  564.          Top             =   600
  565.          Width           =   795
  566.       End
  567.       Begin VB.Label Label3 
  568.          Caption         =   "培训方式"
  569.          Height          =   165
  570.          Left            =   4515
  571.          TabIndex        =   8
  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        =   5
  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        =   1
  590.          Top             =   240
  591.          Width           =   945
  592.       End
  593.    End
  594. End
  595. Attribute VB_Name = "main_jbzl_pxkc"
  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 sdate, edate
  605.   Dim i As Integer
  606.   If Adodc1.Recordset.RecordCount > 0 Then
  607.   For i = 0 To 2
  608.     Text1(i) = DataGrid1.Columns(i).text
  609.   Next i
  610.   Combo1 = DataGrid1.Columns(3)
  611.   Text1(3) = DataGrid1.Columns(4)
  612.   Combo2 = DataGrid1.Columns(5)
  613.   If DataGrid1.Columns(6).text = "是" Then Check1.Value = 1 Else Check1.Value = 0
  614.   Text1(4) = DataGrid1.Columns(7)
  615.   Text1(5) = DataGrid1.Columns(8)
  616.   If DataGrid1.Columns(9) <> "" Then DTPicker1.Value = DataGrid1.Columns(9)
  617.   If DataGrid1.Columns(10) <> "" Then DTPicker2.Value = DataGrid1.Columns(10)
  618.   End If
  619. End Sub
  620. Sub tlbState(state As Boolean)
  621.   With Toolbar1
  622.     If state = True Then
  623.        .Buttons(1).Enabled = False
  624.        .Buttons(2).Enabled = False
  625.        .Buttons(3).Enabled = False
  626.        .Buttons(5).Enabled = True
  627.        .Buttons(6).Enabled = True
  628.        For i = 1 To Text1.UBound
  629.          Text1(i).Locked = False
  630.        Next i
  631.     Else
  632.        .Buttons(1).Enabled = True
  633.        .Buttons(2).Enabled = True
  634.        .Buttons(3).Enabled = True
  635.        .Buttons(5).Enabled = False
  636.        .Buttons(6).Enabled = False
  637.        For i = 1 To Text1.UBound
  638.          Text1(i).Locked = True
  639.        Next i
  640.      End If
  641.    End With
  642. End Sub
  643. Private Sub Check1_KeyDown(KeyCode As Integer, Shift As Integer)
  644.   If KeyCode = vbKeyReturn Then Text1(4).SetFocus
  645. End Sub
  646. Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
  647.   If KeyCode = vbKeyReturn Then Text1(3).SetFocus
  648. End Sub
  649. Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
  650.   If KeyCode = vbKeyReturn Then Check1.SetFocus
  651. End Sub
  652. Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  653.   view_data
  654. End Sub
  655. Private Sub DTPicker1_Change()
  656.  Text1(4) = DateDiff("h", DTPicker1.Value, DTPicker2.Value)
  657. End Sub
  658. Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
  659.   If KeyCode = vbKeyReturn Then DTPicker2.SetFocus
  660. End Sub
  661. Private Sub DTPicker2_Change()
  662.  Text1(4) = DateDiff("h", DTPicker1.Value, DTPicker2.Value)
  663. End Sub
  664. Private Sub Form_Activate()
  665.   If sql1 <> "" Then
  666.      Adodc1.RecordSource = sql1
  667.      Adodc1.Refresh
  668.      If Adodc1.Recordset.RecordCount > 0 Then
  669.         view_data
  670.      Else
  671.         MsgBox "没有找到符合条件的记录!", , "提示窗口"
  672.      End If
  673.   End If
  674. End Sub
  675. Private Sub Form_Load()
  676.   Me.Caption = text
  677.   tlbState False
  678.   Combo1.AddItem "内训"
  679.   Combo1.AddItem "外训"
  680.   Combo2.AddItem "面授"
  681.   Combo2.AddItem "讨论"
  682.   Combo2.AddItem "座谈"
  683.   Combo2.AddItem "讲座"
  684.   Combo2.AddItem "面授+座谈"
  685.   Combo2.AddItem "其它"
  686. End Sub
  687. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  688.   sql1 = ""
  689. End Sub
  690. Private Sub Text1_GotFocus(Index As Integer)
  691.   Text1(Index).BackColor = &HFFFF00
  692.   Text1(Index).SelStart = 0
  693.   Text1(Index).SelLength = Len(Text1(Index))
  694. End Sub
  695. Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
  696.   If KeyCode = vbKeyReturn And Index < 2 Then Text1(Index + 1).SetFocus
  697.   If KeyCode = vbKeyReturn And Index = 2 Then Combo1.SetFocus
  698.   If KeyCode = vbKeyReturn And Index = 3 Then Combo2.SetFocus
  699.   If KeyCode = vbKeyReturn And Index = 4 Then Text1(5).SetFocus
  700.   If KeyCode = vbKeyReturn And Index = 5 Then DTPicker1.SetFocus
  701. End Sub
  702. Private Sub Text1_LostFocus(Index As Integer)
  703.   Text1(Index).BackColor = &H80000005
  704. End Sub
  705. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  706.   Select Case Button.Key
  707.      Case "add"
  708.        blnAdd = True
  709.        tlbState True
  710.        rs1.Open "select * from 培训课程表", Cnn, adOpenStatic
  711.        If rs1.RecordCount > 0 Then
  712.           rs1.MoveLast
  713.           Text1(0) = Format(Val(rs1.Fields("课程编号")) + 1, "00")
  714.        Else
  715.           Text1(0) = "01"
  716.        End If
  717.        rs1.Close
  718.        For i = 1 To Text1.UBound
  719.            Text1(i) = ""
  720.        Next i
  721.        Text1(1).SetFocus
  722.      Case "modify"
  723.        If Adodc1.Recordset.RecordCount > 0 Then
  724.          blnAdd = False
  725.          tlbState True
  726.          view_data
  727.          mybookmark = DataGrid1.Bookmark
  728.        Else
  729.          MsgBox "系统没有要修改的数据!", , "提示窗口"
  730.        End If
  731.      Case "delete"
  732.        If Adodc1.Recordset.RecordCount > 0 Then
  733.          Adodc1.Recordset.Delete
  734.          Adodc1.Refresh
  735.        Else
  736.          MsgBox "系统没有要删除的数据!", , "提示窗口"
  737.        End If
  738.      Case "save"
  739.        Dim strPx As String
  740.        If Check1.Value = 1 Then strPx = "是" Else strPx = "否"
  741.        On Error GoTo SaveErr
  742.        If Text1(0).text = "" Then
  743.           MsgBox "系统不允许" & Label1 & "为空!", , "提示窗口"
  744.           Exit Sub
  745.        End If
  746.        For i = 4 To 5
  747.           If IsNumeric(Text1(i)) = False Then
  748.             Text1(i) = Val(Text1(i))
  749.           End If
  750.        Next i
  751.        If blnAdd = True Then
  752.           Cnn.Execute ("insert into 培训课程表(课程编号,课程名称,主办单位,培训方式,授课对象,授课方式,是否认证,授课时数,费用,开课时间,结束时间) values('" + Text1(0) + _
  753.           "','" + Text1(1) + "','" + Text1(2) + "','" + Combo1 + "','" + Text1(3) + "','" + Combo2 + "','" + strPx + "'," + Text1(4) + "," + Text1(5) + ",'" + str(DTPicker1) + "','" + str(DTPicker2) + "')")
  754.           Adodc1.Refresh
  755.           tlbState False
  756.         Else
  757.           Cnn.Execute ("update 培训课程表 set 课程名称 ='" + Text1(1) + "',主办单位 ='" + Text1(2) + _
  758.           "',培训方式 ='" + Combo1 + "',授课对象 ='" + Text1(3) + "', 授课方式='" + Combo2 + _
  759.           "',是否认证='" + strPx + "',授课时数=" + Text1(4) + ",费用=" + Text1(5) + ",开课时间='" + _
  760.           str(DTPicker1) + "',结束时间='" + str(DTPicker2) + "'where 课程编号='" + Text1(0) + "'")
  761.           Adodc1.Refresh
  762.           DataGrid1.Bookmark = mybookmark
  763.           view_data
  764.           tlbState False
  765.        End If
  766.        Exit Sub
  767. SaveErr:
  768.         MsgBox Err.Description
  769.      Case "cancel"
  770.        tlbState False
  771.      Case "find"
  772.        tb1 = "培训课程表"
  773.        Load main_fzfind
  774.        main_fzfind.Show 1
  775.      Case "all"
  776.        Adodc1.RecordSource = "培训课程表 order by 课程编号"
  777.        Adodc1.Refresh
  778.      Case "close"
  779.        Unload Me
  780.   End Select
  781. End Sub