+
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:67k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{65A39231-6133-11D1-BAA2-444553540000}#1.0#0"; "vslight6.OCX"
  3. Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
  4. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  5. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  6. Begin VB.Form Tr_VehicleFile 
  7.    BorderStyle     =   1  'Fixed Single
  8.    Caption         =   "车辆档案"
  9.    ClientHeight    =   7095
  10.    ClientLeft      =   45
  11.    ClientTop       =   330
  12.    ClientWidth     =   9375
  13.    Icon            =   "基础设置_车辆档案.frx":0000
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form1"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   7095
  19.    ScaleWidth      =   9375
  20.    StartUpPosition =   1  '所有者中心
  21.    Begin TabDlg.SSTab StTab 
  22.       Height          =   6435
  23.       Left            =   30
  24.       TabIndex        =   16
  25.       Top             =   660
  26.       Width           =   9360
  27.       _ExtentX        =   16510
  28.       _ExtentY        =   11351
  29.       _Version        =   393216
  30.       Style           =   1
  31.       Tabs            =   2
  32.       TabHeight       =   520
  33.       TabCaption(0)   =   "列表视图"
  34.       TabPicture(0)   =   "基础设置_车辆档案.frx":1042
  35.       Tab(0).ControlEnabled=   -1  'True
  36.       Tab(0).Control(0)=   "CzxsGrid"
  37.       Tab(0).Control(0).Enabled=   0   'False
  38.       Tab(0).ControlCount=   1
  39.       TabCaption(1)   =   "单张视图"
  40.       TabPicture(1)   =   "基础设置_车辆档案.frx":105E
  41.       Tab(1).ControlEnabled=   0   'False
  42.       Tab(1).Control(0)=   "Frame1"
  43.       Tab(1).ControlCount=   1
  44.       Begin VB.Frame Frame1 
  45.          Height          =   5925
  46.          Left            =   -74880
  47.          TabIndex        =   17
  48.          Top             =   360
  49.          Width           =   9105
  50.          Begin VB.TextBox LrText 
  51.             Height          =   300
  52.             Index           =   14
  53.             Left            =   1410
  54.             TabIndex        =   14
  55.             Text            =   "14"
  56.             Top             =   3090
  57.             Width           =   2610
  58.          End
  59.          Begin VB.CommandButton Ydcommand1 
  60.             Height          =   300
  61.             Index           =   10
  62.             Left            =   4020
  63.             Picture         =   "基础设置_车辆档案.frx":107A
  64.             Style           =   1  'Graphical
  65.             TabIndex        =   38
  66.             Top             =   2310
  67.             Visible         =   0   'False
  68.             Width           =   300
  69.          End
  70.          Begin VB.CheckBox Chk_Scrap 
  71.             Alignment       =   1  'Right Justify
  72.             Caption         =   "停用:"
  73.             Height          =   285
  74.             Left            =   4560
  75.             TabIndex        =   37
  76.             Top             =   3120
  77.             Width           =   1365
  78.          End
  79.          Begin VB.TextBox LrText 
  80.             Height          =   300
  81.             Index           =   13
  82.             Left            =   5745
  83.             TabIndex        =   13
  84.             Text            =   "13"
  85.             Top             =   2670
  86.             Width           =   2610
  87.          End
  88.          Begin VB.TextBox LrText 
  89.             Height          =   300
  90.             Index           =   1
  91.             Left            =   5745
  92.             TabIndex        =   1
  93.             Text            =   "1"
  94.             Top             =   330
  95.             Width           =   2610
  96.          End
  97.          Begin VB.TextBox LrText 
  98.             Height          =   300
  99.             Index           =   3
  100.             Left            =   5745
  101.             TabIndex        =   3
  102.             Text            =   "3"
  103.             Top             =   720
  104.             Width           =   2610
  105.          End
  106.          Begin VB.TextBox LrText 
  107.             Height          =   300
  108.             Index           =   5
  109.             Left            =   5745
  110.             TabIndex        =   5
  111.             Text            =   "5"
  112.             Top             =   1110
  113.             Width           =   2610
  114.          End
  115.          Begin VB.TextBox LrText 
  116.             Height          =   300
  117.             Index           =   7
  118.             Left            =   5745
  119.             TabIndex        =   7
  120.             Text            =   "7"
  121.             Top             =   1500
  122.             Width           =   2610
  123.          End
  124.          Begin VB.TextBox LrText 
  125.             Height          =   300
  126.             Index           =   9
  127.             Left            =   5745
  128.             TabIndex        =   9
  129.             Text            =   "9"
  130.             Top             =   1890
  131.             Width           =   2610
  132.          End
  133.          Begin VB.TextBox LrText 
  134.             Height          =   300
  135.             Index           =   11
  136.             Left            =   5745
  137.             TabIndex        =   11
  138.             Text            =   "11"
  139.             Top             =   2280
  140.             Width           =   2610
  141.          End
  142.          Begin VB.TextBox LrText 
  143.             Height          =   300
  144.             Index           =   0
  145.             Left            =   1410
  146.             TabIndex        =   0
  147.             Text            =   "0"
  148.             Top             =   330
  149.             Width           =   2610
  150.          End
  151.          Begin VB.TextBox LrText 
  152.             Height          =   300
  153.             Index           =   2
  154.             Left            =   1410
  155.             TabIndex        =   2
  156.             Text            =   "2"
  157.             Top             =   720
  158.             Width           =   2610
  159.          End
  160.          Begin VB.CommandButton Ydcommand1 
  161.             Height          =   300
  162.             Index           =   0
  163.             Left            =   4020
  164.             Picture         =   "基础设置_车辆档案.frx":1404
  165.             Style           =   1  'Graphical
  166.             TabIndex        =   19
  167.             Top             =   720
  168.             Visible         =   0   'False
  169.             Width           =   300
  170.          End
  171.          Begin VB.CommandButton QxCommand 
  172.             Cancel          =   -1  'True
  173.             Caption         =   "取消(&C)"
  174.             Height          =   300
  175.             Left            =   7235
  176.             TabIndex        =   18
  177.             Top             =   3870
  178.             Width           =   1120
  179.          End
  180.          Begin VB.CommandButton BcCommand 
  181.             Caption         =   "保存(&S)"
  182.             Height          =   300
  183.             Left            =   6030
  184.             TabIndex        =   15
  185.             Top             =   3870
  186.             Width           =   1120
  187.          End
  188.          Begin VB.TextBox LrText 
  189.             Height          =   300
  190.             Index           =   12
  191.             Left            =   1410
  192.             TabIndex        =   12
  193.             Text            =   "12"
  194.             Top             =   2700
  195.             Width           =   2610
  196.          End
  197.          Begin VB.TextBox LrText 
  198.             Height          =   300
  199.             Index           =   4
  200.             Left            =   1410
  201.             TabIndex        =   4
  202.             Text            =   "4"
  203.             Top             =   1125
  204.             Width           =   2610
  205.          End
  206.          Begin VB.TextBox LrText 
  207.             Height          =   300
  208.             Index           =   6
  209.             Left            =   1410
  210.             TabIndex        =   6
  211.             Text            =   "6"
  212.             Top             =   1515
  213.             Width           =   2610
  214.          End
  215.          Begin VB.TextBox LrText 
  216.             Height          =   300
  217.             Index           =   8
  218.             Left            =   1410
  219.             TabIndex        =   8
  220.             Text            =   "8"
  221.             Top             =   1905
  222.             Width           =   2610
  223.          End
  224.          Begin VB.TextBox LrText 
  225.             Height          =   300
  226.             Index           =   10
  227.             Left            =   1410
  228.             TabIndex        =   10
  229.             Text            =   "10"
  230.             Top             =   2295
  231.             Width           =   2610
  232.          End
  233.          Begin VB.Label TsLabel 
  234.             AutoSize        =   -1  'True
  235.             Caption         =   "车辆所有权:"
  236.             Height          =   180
  237.             Index           =   8
  238.             Left            =   4560
  239.             TabIndex        =   39
  240.             Top             =   1170
  241.             Width           =   990
  242.          End
  243.          Begin VB.Label TsLabel 
  244.             AutoSize        =   -1  'True
  245.             Caption         =   "备注:"
  246.             Height          =   180
  247.             Index           =   14
  248.             Left            =   555
  249.             TabIndex        =   36
  250.             Top             =   3180
  251.             Width           =   450
  252.          End
  253.          Begin VB.Label TsLabel 
  254.             AutoSize        =   -1  'True
  255.             Caption         =   "车辆类型:"
  256.             Height          =   180
  257.             Index           =   13
  258.             Left            =   4560
  259.             TabIndex        =   35
  260.             Top             =   390
  261.             Width           =   810
  262.          End
  263.          Begin VB.Label TsLabel 
  264.             AutoSize        =   -1  'True
  265.             Caption         =   "车辆使用性质:"
  266.             Height          =   180
  267.             Index           =   12
  268.             Left            =   4560
  269.             TabIndex        =   34
  270.             Top             =   780
  271.             Width           =   1170
  272.          End
  273.          Begin VB.Label TsLabel 
  274.             AutoSize        =   -1  'True
  275.             Caption         =   "自重:"
  276.             Height          =   180
  277.             Index           =   11
  278.             Left            =   555
  279.             TabIndex        =   33
  280.             Top             =   1590
  281.             Width           =   450
  282.          End
  283.          Begin VB.Label TsLabel 
  284.             AutoSize        =   -1  'True
  285.             Caption         =   "原值:"
  286.             Height          =   180
  287.             Index           =   10
  288.             Left            =   555
  289.             TabIndex        =   32
  290.             Top             =   1980
  291.             Width           =   450
  292.          End
  293.          Begin VB.Label TsLabel 
  294.             AutoSize        =   -1  'True
  295.             Caption         =   "出厂日期:"
  296.             Height          =   180
  297.             Index           =   9
  298.             Left            =   555
  299.             TabIndex        =   31
  300.             Top             =   2385
  301.             Width           =   810
  302.          End
  303.          Begin VB.Label TsLabel 
  304.             AutoSize        =   -1  'True
  305.             Caption         =   "制造单位:"
  306.             Height          =   180
  307.             Index           =   7
  308.             Left            =   555
  309.             TabIndex        =   30
  310.             Top             =   2775
  311.             Width           =   810
  312.          End
  313.          Begin VB.Label TsLabel 
  314.             AutoSize        =   -1  'True
  315.             Caption         =   "车号:"
  316.             Height          =   180
  317.             Index           =   0
  318.             Left            =   555
  319.             TabIndex        =   26
  320.             Top             =   390
  321.             Width           =   450
  322.          End
  323.          Begin VB.Label TsLabel 
  324.             AutoSize        =   -1  'True
  325.             Caption         =   "车辆等级:"
  326.             Height          =   180
  327.             Index           =   1
  328.             Left            =   555
  329.             TabIndex        =   25
  330.             Top             =   795
  331.             Width           =   810
  332.          End
  333.          Begin VB.Label TsLabel 
  334.             AutoSize        =   -1  'True
  335.             Caption         =   "车辆状况:"
  336.             Height          =   180
  337.             Index           =   2
  338.             Left            =   555
  339.             TabIndex        =   24
  340.             Top             =   1185
  341.             Width           =   810
  342.          End
  343.          Begin VB.Label TsLabel 
  344.             AutoSize        =   -1  'True
  345.             Caption         =   "载重:"
  346.             Height          =   180
  347.             Index           =   3
  348.             Left            =   4560
  349.             TabIndex        =   23
  350.             Top             =   1560
  351.             Width           =   450
  352.          End
  353.          Begin VB.Label TsLabel 
  354.             AutoSize        =   -1  'True
  355.             Caption         =   "年折旧率:"
  356.             Height          =   180
  357.             Index           =   4
  358.             Left            =   4560
  359.             TabIndex        =   22
  360.             Top             =   1950
  361.             Width           =   810
  362.          End
  363.          Begin VB.Label TsLabel 
  364.             AutoSize        =   -1  'True
  365.             Caption         =   "使用年限:"
  366.             Height          =   180
  367.             Index           =   5
  368.             Left            =   4560
  369.             TabIndex        =   21
  370.             Top             =   2340
  371.             Width           =   810
  372.          End
  373.          Begin VB.Label TsLabel 
  374.             AutoSize        =   -1  'True
  375.             Caption         =   "产权单位:"
  376.             Height          =   180
  377.             Index           =   6
  378.             Left            =   4560
  379.             TabIndex        =   20
  380.             Top             =   2730
  381.             Width           =   810
  382.          End
  383.       End
  384.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  385.          Height          =   5925
  386.          Left            =   90
  387.          TabIndex        =   27
  388.          Top             =   390
  389.          Width           =   9165
  390.          _ExtentX        =   16166
  391.          _ExtentY        =   10451
  392.          Appearance      =   1
  393.          BorderStyle     =   1
  394.          Enabled         =   -1  'True
  395.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  396.             Name            =   "宋体"
  397.             Size            =   9
  398.             Charset         =   134
  399.             Weight          =   400
  400.             Underline       =   0   'False
  401.             Italic          =   0   'False
  402.             Strikethrough   =   0   'False
  403.          EndProperty
  404.          MousePointer    =   0
  405.          BackColor       =   -2147483643
  406.          ForeColor       =   -2147483640
  407.          BackColorFixed  =   -2147483633
  408.          ForeColorFixed  =   -2147483630
  409.          BackColorSel    =   -2147483635
  410.          ForeColorSel    =   -2147483634
  411.          BackColorBkg    =   8421504
  412.          BackColorAlternate=   -2147483643
  413.          GridColor       =   -2147483633
  414.          GridColorFixed  =   -2147483632
  415.          TreeColor       =   -2147483632
  416.          FloodColor      =   192
  417.          SheetBorder     =   -2147483642
  418.          FocusRect       =   1
  419.          HighLight       =   1
  420.          AllowSelection  =   -1  'True
  421.          AllowBigSelection=   -1  'True
  422.          AllowUserResizing=   0
  423.          SelectionMode   =   0
  424.          GridLines       =   1
  425.          GridLinesFixed  =   2
  426.          GridLineWidth   =   1
  427.          Rows            =   5000
  428.          Cols            =   10
  429.          FixedRows       =   1
  430.          FixedCols       =   0
  431.          RowHeightMin    =   0
  432.          RowHeightMax    =   0
  433.          ColWidthMin     =   0
  434.          ColWidthMax     =   0
  435.          ExtendLastCol   =   0   'False
  436.          FormatString    =   ""
  437.          ScrollTrack     =   0   'False
  438.          ScrollBars      =   3
  439.          ScrollTips      =   0   'False
  440.          MergeCells      =   0
  441.          MergeCompare    =   0
  442.          AutoResize      =   -1  'True
  443.          AutoSizeMode    =   0
  444.          AutoSearch      =   0
  445.          MultiTotals     =   -1  'True
  446.          SubtotalPosition=   1
  447.          OutlineBar      =   0
  448.          OutlineCol      =   0
  449.          Ellipsis        =   0
  450.          ExplorerBar     =   0
  451.          PicturesOver    =   0   'False
  452.          FillStyle       =   0
  453.          RightToLeft     =   0   'False
  454.          PictureType     =   0
  455.          TabBehavior     =   0
  456.          OwnerDraw       =   0
  457.          Editable        =   0   'False
  458.          ShowComboButton =   -1  'True
  459.          WordWrap        =   0   'False
  460.          TextStyle       =   0
  461.          TextStyleFixed  =   0
  462.          OleDragMode     =   0
  463.          OleDropMode     =   0
  464.          DataMode        =   0
  465.          VirtualData     =   -1  'True
  466.       End
  467.    End
  468.    Begin MSComctlLib.Toolbar SzToolbar 
  469.       Align           =   1  'Align Top
  470.       Height          =   570
  471.       Left            =   0
  472.       TabIndex        =   28
  473.       Top             =   0
  474.       Width           =   9375
  475.       _ExtentX        =   16536
  476.       _ExtentY        =   1005
  477.       ButtonWidth     =   820
  478.       ButtonHeight    =   953
  479.       AllowCustomize  =   0   'False
  480.       Appearance      =   1
  481.       Style           =   1
  482.       ImageList       =   "ImageList1"
  483.       _Version        =   393216
  484.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  485.          NumButtons      =   12
  486.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  487.             Caption         =   "设置"
  488.             Key             =   "ymsz"
  489.             ImageKey        =   "sz"
  490.          EndProperty
  491.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  492.             Caption         =   "打印"
  493.             Key             =   "dy"
  494.             Object.ToolTipText     =   "点击或按Ctrl+P打印表格"
  495.             ImageKey        =   "dy"
  496.          EndProperty
  497.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  498.             Caption         =   "预览"
  499.             Key             =   "yl"
  500.             ImageKey        =   "yl"
  501.          EndProperty
  502.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  503.             Style           =   3
  504.          EndProperty
  505.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  506.             Caption         =   "增加"
  507.             Key             =   "zj"
  508.             Object.ToolTipText     =   "点击或按Ctrl+A增加记录"
  509.             ImageKey        =   "xz"
  510.          EndProperty
  511.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  512.             Caption         =   "修改"
  513.             Key             =   "xg"
  514.             ImageKey        =   "xg"
  515.          EndProperty
  516.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  517.             Caption         =   "删除"
  518.             Key             =   "sc"
  519.             Object.ToolTipText     =   "点击或按Ctrl+D删除当前记录"
  520.             ImageKey        =   "sc"
  521.          EndProperty
  522.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  523.             Style           =   3
  524.          EndProperty
  525.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  526.             Caption         =   "刷新"
  527.             Key             =   "sx"
  528.             ImageKey        =   "sx"
  529.          EndProperty
  530.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  531.             Style           =   3
  532.          EndProperty
  533.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  534.             Caption         =   "帮助"
  535.             Key             =   "bz"
  536.             ImageKey        =   "bz"
  537.          EndProperty
  538.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  539.             Caption         =   "退出"
  540.             Key             =   "fh"
  541.             ImageKey        =   "tc"
  542.          EndProperty
  543.       EndProperty
  544.       BorderStyle     =   1
  545.       Begin MSComctlLib.Toolbar GsToolbar 
  546.          Height          =   540
  547.          Left            =   6870
  548.          TabIndex        =   29
  549.          Top             =   0
  550.          Width           =   2475
  551.          _ExtentX        =   4366
  552.          _ExtentY        =   953
  553.          ButtonWidth     =   1455
  554.          ButtonHeight    =   953
  555.          AllowCustomize  =   0   'False
  556.          Appearance      =   1
  557.          Style           =   1
  558.          ImageList       =   "ImageList1"
  559.          _Version        =   393216
  560.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  561.             NumButtons      =   3
  562.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  563.                Caption         =   "保存格式"
  564.                Key             =   "bcgs"
  565.                ImageKey        =   "bcgs"
  566.             EndProperty
  567.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  568.                Caption         =   "默认列宽"
  569.                Key             =   "hfmrgs"
  570.                ImageKey        =   "mrlk"
  571.             EndProperty
  572.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  573.                Caption         =   "显示项目"
  574.                Key             =   "szxsxm"
  575.                ImageKey        =   "xsxm"
  576.             EndProperty
  577.          EndProperty
  578.       End
  579.    End
  580.    Begin MSComctlLib.ImageList ImageList1 
  581.       Left            =   0
  582.       Top             =   420
  583.       _ExtentX        =   1005
  584.       _ExtentY        =   1005
  585.       BackColor       =   -2147483643
  586.       ImageWidth      =   16
  587.       ImageHeight     =   16
  588.       MaskColor       =   12632256
  589.       _Version        =   393216
  590.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  591.          NumListImages   =   29
  592.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  593.             Picture         =   "基础设置_车辆档案.frx":178E
  594.             Key             =   "sz"
  595.          EndProperty
  596.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  597.             Picture         =   "基础设置_车辆档案.frx":1B28
  598.             Key             =   "dy"
  599.          EndProperty
  600.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  601.             Picture         =   "基础设置_车辆档案.frx":1EC2
  602.             Key             =   "yl"
  603.          EndProperty
  604.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  605.             Picture         =   "基础设置_车辆档案.frx":225C
  606.             Key             =   "xg"
  607.          EndProperty
  608.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  609.             Picture         =   "基础设置_车辆档案.frx":25F6
  610.             Key             =   "zh"
  611.          EndProperty
  612.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  613.             Picture         =   "基础设置_车辆档案.frx":2990
  614.             Key             =   "sh"
  615.          EndProperty
  616.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  617.             Picture         =   "基础设置_车辆档案.frx":2D2A
  618.             Key             =   "bc"
  619.          EndProperty
  620.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  621.             Picture         =   "基础设置_车辆档案.frx":30C4
  622.             Key             =   "fq"
  623.          EndProperty
  624.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  625.             Picture         =   "基础设置_车辆档案.frx":345E
  626.             Key             =   "bz"
  627.          EndProperty
  628.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  629.             Picture         =   "基础设置_车辆档案.frx":37F8
  630.             Key             =   "tc"
  631.          EndProperty
  632.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  633.             Picture         =   "基础设置_车辆档案.frx":3B92
  634.             Key             =   "bcgs"
  635.          EndProperty
  636.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  637.             Picture         =   "基础设置_车辆档案.frx":3F2C
  638.             Key             =   "mrlk"
  639.          EndProperty
  640.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  641.             Picture         =   "基础设置_车辆档案.frx":42C6
  642.             Key             =   "xsxm"
  643.          EndProperty
  644.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  645.             Picture         =   "基础设置_车辆档案.frx":4660
  646.             Key             =   "first"
  647.          EndProperty
  648.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  649.             Picture         =   "基础设置_车辆档案.frx":49FA
  650.             Key             =   "prev"
  651.          EndProperty
  652.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  653.             Picture         =   "基础设置_车辆档案.frx":4D94
  654.             Key             =   "next"
  655.          EndProperty
  656.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  657.             Picture         =   "基础设置_车辆档案.frx":512E
  658.             Key             =   "last"
  659.          EndProperty
  660.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  661.             Picture         =   "基础设置_车辆档案.frx":54C8
  662.             Key             =   "xx"
  663.          EndProperty
  664.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  665.             Picture         =   "基础设置_车辆档案.frx":5862
  666.             Key             =   "define"
  667.          EndProperty
  668.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  669.             Picture         =   "基础设置_车辆档案.frx":5BFC
  670.             Key             =   "exec"
  671.          EndProperty
  672.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  673.             Picture         =   "基础设置_车辆档案.frx":5F96
  674.             Key             =   "xz"
  675.          EndProperty
  676.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  677.             Picture         =   "基础设置_车辆档案.frx":6330
  678.             Key             =   "sc"
  679.          EndProperty
  680.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  681.             Picture         =   "基础设置_车辆档案.frx":66CA
  682.             Key             =   "sx"
  683.          EndProperty
  684.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  685.             Picture         =   "基础设置_车辆档案.frx":6A64
  686.             Key             =   "cx"
  687.          EndProperty
  688.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  689.             Picture         =   "基础设置_车辆档案.frx":6DFE
  690.             Key             =   "zd"
  691.          EndProperty
  692.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  693.             Picture         =   "基础设置_车辆档案.frx":7198
  694.             Key             =   "dz"
  695.          EndProperty
  696.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  697.             Picture         =   "基础设置_车辆档案.frx":7532
  698.             Key             =   "ph"
  699.          EndProperty
  700.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  701.             Picture         =   "基础设置_车辆档案.frx":78CC
  702.             Key             =   "fz"
  703.          EndProperty
  704.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  705.             Picture         =   "基础设置_车辆档案.frx":7C66
  706.             Key             =   "dw"
  707.          EndProperty
  708.       EndProperty
  709.    End
  710. End
  711. Attribute VB_Name = "Tr_VehicleFile"
  712. Attribute VB_GlobalNameSpace = False
  713. Attribute VB_Creatable = False
  714. Attribute VB_PredeclaredId = True
  715. Attribute VB_Exposed = False
  716. '**********************************************************
  717. '*    模 块 名 称 :车辆档案设置
  718. '*    功 能 描 述 :设置企业的车辆档案
  719. '*    程序员姓名  :孙宝龙
  720. '*    最后修改人  :孙宝龙
  721. '*    最后修改时间:2001/12/06
  722. '*    备        注:封版(*所有自定义部分程序均用[>> <<]括起)
  723. '**********************************************************
  724. Dim StopFlag As Integer                  '停用标志判断
  725. Dim Int_Empty As Integer
  726. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  727. Dim jdzygs As Integer                    '控件焦点转移个数
  728. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  729. Dim ReportTitle As String                '报表主标题
  730. Dim Str_RightEdit As String              '编辑(新增、修改、删除)权限索引
  731. '以下为固定使用变量(网格)
  732. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  733. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  734. Dim GridCode As String                   '显示网格网格代码
  735. Dim GridInf() As Variant                 '整个网格设置信息
  736. Dim Tsxx As String                       '系统提示信息
  737. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  738. Dim Sjhgd As Double                      '网格数据行高度
  739. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  740. Dim GridStr()  As String                 '网格列信息(字符型)
  741. Dim GridInt() As Integer                 '网格列信息(整型)
  742. Dim szzls As Integer                     '数组总列数(网格列数-1)
  743. '以下为固定使用变量(文本框)
  744. Dim Textvar() As Variant                 '存储变体型文本框信息
  745. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  746. Dim Textint() As Integer                 '存储整型文本框信息
  747. Dim Textstr() As String                  '存储字符型文本框信息
  748. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  749. Dim TextGroupCode As String              '文本框录入分组编码
  750. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  751. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  752. Dim CurTextIndex As Integer              '当前文本框索引值
  753. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  754. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  755. Private Sub Chk_Scrap_Click()
  756.    If Int_Empty = 1 Then Exit Sub
  757.    If StopFlag = 1 Then Exit Sub
  758.     If Chk_Scrap.Value = 1 Then
  759.         Tsxx = "确认要停用这辆车吗?"
  760.         If Xtxxts(Tsxx, 1, 2) = 6 Then
  761.             For jsqte = 0 To Max_Text_Index
  762.                 LrText(jsqte).Enabled = False
  763.                 If Textboolean(jsqte, 1) Then
  764.                   Ydcommand1(jsqte).Enabled = False
  765.                 End If
  766.             Next jsqte
  767.         Else
  768.             StopFlag = 1
  769.             Chk_Scrap.Value = 0
  770.             StopFlag = 0
  771.             Exit Sub
  772.         End If
  773.     Else
  774.         Tsxx = "确认这辆车不停用吗?"
  775.         If Xtxxts(Tsxx, 1, 2) = 6 Then
  776.            For jsqte = 0 To Max_Text_Index
  777.                 LrText(jsqte).Enabled = True
  778.                 If Textboolean(jsqte, 1) Then
  779.                   Ydcommand1(jsqte).Enabled = True
  780.                 End If
  781.             Next jsqte
  782.             If Lrzt = 1 Then
  783.                LrText(0).SetFocus
  784.             Else
  785.                LrText(1).SetFocus
  786.                LrText(0).Enabled = False
  787.             End If
  788.         Else
  789.             StopFlag = 1
  790.             Chk_Scrap.Value = 1
  791.             StopFlag = 0
  792.             Exit Sub
  793.         End If
  794.     End If
  795.     Int_Empty = 0
  796. End Sub
  797. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  798.     jdzygs = 16
  799.     
  800.     Select Case KeyAscii
  801.         Case vbKeyReturn
  802.             If Kjjdzy(jdzygs) Then
  803.                 KeyAscii = 0
  804.             End If
  805.         Case 39           '屏蔽"'"
  806.             KeyAscii = 0
  807.     End Select
  808.    
  809. End Sub
  810. Private Sub Form_Load()
  811.   
  812.     '打印报表标题信息
  813.     ReportTitle = "车 辆 档 案"
  814.      
  815.     '调入打印页面设置窗体
  816.     XtReportCode = "Tr_VehicleFile"
  817.     Load Dyymctbl
  818.     
  819.     '以下为文本框处理程序(读入文本框录入信息)
  820.     TextGroupCode = "Tr_VehicleFile"
  821.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  822.     Call Wbkcsh
  823.     
  824.     '调入网格设置信息
  825.     GridCode = "Tr_VehicleFile"
  826.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  827.     Qslz = GridInf(1)
  828.     Sjhgd = GridInf(2)
  829.     szzls = CzxsGrid.Cols - 1
  830.     
  831.     '填 充 网 格
  832.     Call Cxnrtcwg
  833.        
  834.     '初始化ToolBar,Tab卡状态
  835.     StTab.Tab = 0
  836.     StTab.TabEnabled(1) = False
  837.     Frame1.Enabled = False
  838.     
  839.     '设置为非录入状态
  840.     Lrzt = 0
  841.      '[<<自定义
  842.     StopFlag = 0
  843.     '>>]
  844.     
  845.     '编辑(新增、修改、删除)权限索引
  846.     Str_RightEdit = "Tr_VehicleFile_Edit"
  847.     
  848.  End Sub
  849.  
  850. Private Sub Cxnrtcwg()                               '查询内容填充网格
  851.     Dim Sqlstr As String              '查询连接串
  852.     Dim jsqte As Long                '查询临时使用变量
  853.   
  854.     '为加快显示速度,将网格刷新动作冻结
  855.     CzxsGrid.Redraw = False
  856.   
  857.     '[>>查询连接串
  858.     Sqlstr = "SELECT Tr_V_VehicleFile.* FROM Tr_V_VehicleFile Order By VehicleNum"
  859.     '<<]
  860.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  861.     
  862.     With Cxnrrec
  863.         CzxsGrid.Rows = CzxsGrid.FixedRows
  864.         If .EOF And .BOF Then
  865.             CzxsGrid.Redraw = True
  866.             Exit Sub
  867.         End If
  868.         jsqte = CzxsGrid.FixedRows
  869.         Do While Not .EOF
  870.             CzxsGrid.AddItem ""
  871.             Call Jltcwg(Cxnrrec, jsqte)                              '调入填充网格子过程
  872.             CzxsGrid.RowHeight(jsqte) = Sjhgd                        '设置网格高度
  873.             .MoveNext
  874.             jsqte = jsqte + 1
  875.         Loop
  876.     End With
  877.   
  878.     '将网格刷新动作解冻
  879.     CzxsGrid.Redraw = True
  880.     
  881. End Sub
  882. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  883.     '[>>以下为自定义部分
  884.     With Jlbrec
  885.        
  886.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), szzls)) = Trim(.Fields("VehicleNum") & "")               '车号
  887.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), szzls)) = Trim(.Fields("TypeName") & "")                 '存货名称
  888.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), szzls)) = Trim(.Fields("NowGradeName") & "")             '车辆等级
  889.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), szzls)) = Trim(.Fields("UseNatureName") & "")            '车辆使用性质
  890.         CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), szzls)) = Trim(.Fields("SituationName") & "")            '车辆状况
  891.         CzxsGrid.TextMatrix(Rowjsq, Sydz("006", GridStr(), szzls)) = Trim(.Fields("OwnerShipName") & "")            '车辆所有权
  892.         If .Fields("SelfWeight") <> 0 Then                                                                          '自重
  893.             CzxsGrid.TextMatrix(Rowjsq, Sydz("007", GridStr(), szzls)) = .Fields("SelfWeight")
  894.         Else
  895.             CzxsGrid.TextMatrix(Rowjsq, Sydz("007", GridStr(), szzls)) = ""
  896.         End If
  897.         If .Fields("LoadWeight") <> 0 Then                                                                          '载重
  898.             CzxsGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), szzls)) = .Fields("LoadWeight")
  899.         Else
  900.             CzxsGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), szzls)) = ""
  901.         End If
  902.         If .Fields("FormerValue") <> 0 Then                                                                         '原值
  903.             CzxsGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), szzls)) = .Fields("FormerValue")
  904.         Else
  905.             CzxsGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), szzls)) = ""
  906.         End If
  907.         If .Fields("YearOld") <> 0 Then                                                                             '年折旧率
  908.             CzxsGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), szzls)) = .Fields("YearOld")
  909.         Else
  910.             CzxsGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), szzls)) = ""
  911.         End If
  912.         If Not IsNull(.Fields("Outdays")) Then                                                                        '出厂日期
  913.             CzxsGrid.TextMatrix(Rowjsq, Sydz("011", GridStr(), szzls)) = Format(Trim(.Fields("Outdays")), "yyyy-mm-dd")
  914.         Else
  915.             CzxsGrid.TextMatrix(Rowjsq, Sydz("011", GridStr(), szzls)) = ""
  916.         End If
  917.         If .Fields("UseYear") <> 0 Then                                                                             '使用年限
  918.             CzxsGrid.TextMatrix(Rowjsq, Sydz("012", GridStr(), szzls)) = .Fields("UseYear")
  919.         Else
  920.             CzxsGrid.TextMatrix(Rowjsq, Sydz("012", GridStr(), szzls)) = ""
  921.         End If
  922.         CzxsGrid.TextMatrix(Rowjsq, Sydz("013", GridStr(), szzls)) = Trim(.Fields("MadeIn") & "")
  923.         CzxsGrid.TextMatrix(Rowjsq, Sydz("014", GridStr(), szzls)) = Trim(.Fields("RightUnit") & "")
  924.         CzxsGrid.TextMatrix(Rowjsq, Sydz("015", GridStr(), szzls)) = Trim(.Fields("Remark") & "")
  925.         If Trim(.Fields("IfScrap")) = True Then
  926.             CzxsGrid.TextMatrix(Rowjsq, Sydz("016", GridStr(), szzls)) = "停用"             '是否停用
  927.         Else
  928.             CzxsGrid.TextMatrix(Rowjsq, Sydz("016", GridStr(), szzls)) = "未停用"
  929.         End If
  930.        
  931.     End With
  932.     '以上为自定义部分<<]
  933.     
  934. End Sub
  935. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  936.     Set Cxnrrec = Nothing
  937.     Set Rec_CodeSet = Nothing
  938.     Unload Dyymctbl
  939.    
  940. End Sub
  941. Private Function Bclrsj() As Boolean                   '判断录入数据有效性,并保存数据
  942.     Dim jsqte As Integer
  943.   
  944.     '对文本框录入内容进行为零和为空判断(固定不变)
  945.     With Rec_CodeSet
  946.         For jsqte = 0 To Max_Text_Index
  947.             If Textint(jsqte, 8) = 1 Then     '字段不能为空
  948.                 If Len(Trim(LrText(jsqte).Text)) = 0 Then
  949.                     Tsxx = Textstr(jsqte, 7) & "不能为空!"
  950.                     Call Xtxxts(Tsxx, 0, 1)
  951.                     LrText(jsqte).SetFocus
  952.                     Bclrsj = False
  953.                     Exit Function
  954.                 End If
  955.             Else
  956.                 If Textint(jsqte, 8) = 2 Then   '字段不能为零
  957.                     If Val(Trim(LrText(jsqte).Text)) = 0 Then
  958.                         Tsxx = Textstr(jsqte, 7) & "不能为零!"
  959.                         Call Xtxxts(Tsxx, 0, 1)
  960.                         LrText(jsqte).SetFocus
  961.                         Bclrsj = False
  962.                         Exit Function
  963.                     End If
  964.                 End If
  965.             End If
  966.         Next jsqte
  967.     
  968.         '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  969.         For jsqte = 0 To Max_Text_Index
  970.             If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  971.                 If Not TextYxxpd(jsqte) Then
  972.                     Exit Function
  973.                 End If
  974.             End If
  975.         Next jsqte
  976.    
  977.         If Lrzt = 1 Then  '增 加
  978.         
  979.             '[>>判断编码是否重复
  980.             If .State = 1 Then
  981.                 Set Rec_CodeSet = Nothing
  982.                 .Close
  983.             End If
  984.             .Open "SELECT * FROM Tr_VehicleFile WHERE VehicleNum= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  985.             
  986.             If Not .EOF Then
  987.                 Tsxx = "车号重复!"
  988.                 Call Xtxxts(Tsxx, 0, 1)
  989.                 LrText(0).SetFocus
  990.                 Bclrsj = False
  991.                 Exit Function
  992.             End If
  993.            
  994.     
  995.     
  996.             '判断记录内容无误后,将记录内容写入数据表
  997.             On Error GoTo Swcwcl
  998.             Cw_DataEnvi.DataConnect.BeginTrans
  999.    
  1000.             .AddNew
  1001.                 .Fields("VehicleNum") = Trim(LrText(0).Text)          '车号
  1002.                 .Fields("TypeCode") = Trim(LrText(1).Tag)             '车辆类型
  1003.                 .Fields("NowGradeCode") = Trim(LrText(2).Tag)         '车辆等级
  1004.                 .Fields("UseNatureCode") = Trim(LrText(3).Tag)        '车辆使用性质
  1005.                 .Fields("SituationCode") = Trim(LrText(4).Tag)        '车辆状况
  1006.                 .Fields("OwnerShipCode") = Trim(LrText(5).Tag)        '车辆所有权
  1007.                 .Fields("SelfWeight") = Val(LrText(6).Text)           '自重
  1008.                 .Fields("LoadWeight") = Val(LrText(7).Text)           '载重
  1009.                 .Fields("FormerValue") = Val(LrText(8).Text)          '原值
  1010.                 .Fields("YearOld") = Val(LrText(9).Text)              '年折旧率
  1011.                 If Trim(LrText(10).Text) <> "" Then
  1012.                   .Fields("Outdays") = Format(Trim(LrText(10).Text), "yyyy-mm-dd")        '出厂日期
  1013.                 Else
  1014.                   .Fields("Outdays") = Null
  1015.                 End If
  1016.                 .Fields("UseYear") = Val(LrText(11).Text)             '使用年限
  1017.                 If Trim(LrText(12).Text) <> "" Then
  1018.                   .Fields("MadeIn") = Trim(LrText(12).Text)           '制造单位
  1019.                 Else
  1020.                   .Fields("MadeIn") = Null
  1021.                 End If
  1022.                 If Trim(LrText(13).Text) <> "" Then
  1023.                   .Fields("RightUnit") = Trim(LrText(13).Text)        '产权单位
  1024.                 Else
  1025.                   .Fields("RightUnit") = Null
  1026.                 End If
  1027.                 If Trim(LrText(14).Text) <> "" Then
  1028.                   .Fields("Remark") = Trim(LrText(14).Text)        '产权单位
  1029.                 Else
  1030.                   .Fields("Remark") = Null
  1031.                 End If
  1032.                 If Chk_Scrap.Value = 1 Then                           '停用标记
  1033.                    .Fields("IfScrap") = 1
  1034.                 Else
  1035.                    .Fields("IfScrap") = 0
  1036.                 End If
  1037.                 
  1038.             .Update
  1039.             
  1040.             Cw_DataEnvi.DataConnect.CommitTrans
  1041.    
  1042.             '将记录加入网格
  1043.             Sqlstr = "SELECT * FROM Tr_V_VehicleFile WHERE VehicleNum= '" + Trim(LrText(0).Text) + "'"
  1044.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1045.             
  1046.             With CzxsGrid
  1047.                 .AddItem ""
  1048.                 .RowHeight(.Rows - 1) = Sjhgd
  1049.                 .Select .Rows - 1, Qslz
  1050.                 Call Jltcwg(Cxnrrec, .Rows - 1)
  1051.             End With
  1052.    
  1053.             Tsxx = "保存完毕!"
  1054.             Call Xtxxts(Tsxx, 0, 4)
  1055.             Int_Empty = 1
  1056.             Call Cshlrxx(1)
  1057.             For jsqte = 0 To Max_Text_Index
  1058.                 LrText(jsqte).Enabled = True
  1059.                 If Textboolean(jsqte, 1) Then
  1060.                   Ydcommand1(jsqte).Enabled = True
  1061.                 End If
  1062.             Next jsqte
  1063.             LrText(0).SetFocus
  1064.             Int_Empty = 1
  1065.               Chk_Scrap.Value = 0
  1066.             Int_Empty = 0
  1067.             '将网格按编码排序
  1068.             With CzxsGrid
  1069.                 .Col = Sydz("001", GridStr(), szzls)
  1070.                 CzxsGrid.Sort = flexSortStringAscending
  1071.             End With
  1072.             '<<]
  1073.     
  1074.         Else  '否则为修改记录
  1075.  
  1076.         
  1077.             On Error GoTo Swcwcl
  1078.         
  1079.             Cw_DataEnvi.DataConnect.BeginTrans
  1080.          
  1081.             If .State = 1 Then
  1082.               Set Rec_CodeSet = Nothing
  1083.               .Close
  1084.             End If
  1085.             .Open "SELECT * FROM Tr_VehicleFile WHERE VehicleNum= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1086.              
  1087.             If Not .EOF Then
  1088.                 .Fields("TypeCode") = Trim(LrText(1).Tag)             '车辆类型
  1089.                 .Fields("NowGradeCode") = Trim(LrText(2).Tag)         '车辆等级
  1090.                 .Fields("UseNatureCode") = Trim(LrText(3).Tag)        '车辆使用性质
  1091.                 .Fields("SituationCode") = Trim(LrText(4).Tag)        '车辆状况
  1092.                 .Fields("OwnerShipCode") = Trim(LrText(5).Tag)        '车辆所有权
  1093.                 .Fields("SelfWeight") = Val(LrText(6).Text)           '自重
  1094.                 .Fields("LoadWeight") = Val(LrText(7).Text)           '载重
  1095.                 .Fields("FormerValue") = Val(LrText(8).Text)          '原值
  1096.                 .Fields("YearOld") = Val(LrText(9).Text)              '年折旧率
  1097.                 If Trim(LrText(10).Text) <> "" Then
  1098.                   .Fields("Outdays") = Format(Trim(LrText(10).Text), "yyyy-mm-dd")        '出厂日期
  1099.                 Else
  1100.                   .Fields("Outdays") = Null
  1101.                 End If
  1102.                 .Fields("UseYear") = Val(LrText(11).Text)             '使用年限
  1103.                 If Trim(LrText(12).Text) <> "" Then
  1104.                   .Fields("MadeIn") = Trim(LrText(12).Text)           '制造单位
  1105.                 Else
  1106.                   .Fields("MadeIn") = Null
  1107.                 End If
  1108.                 If Trim(LrText(13).Text) <> "" Then
  1109.                   .Fields("RightUnit") = Trim(LrText(13).Text)        '产权单位
  1110.                 Else
  1111.                   .Fields("RightUnit") = Null
  1112.                 End If
  1113.                 If Trim(LrText(14).Text) <> "" Then
  1114.                   .Fields("Remark") = Trim(LrText(14).Text)        '产权单位
  1115.                 Else
  1116.                   .Fields("Remark") = Null
  1117.                 End If
  1118.                 If Chk_Scrap.Value = 1 Then                           '停用标记
  1119.                    .Fields("IfScrap") = 1
  1120.                 Else
  1121.                    .Fields("IfScrap") = 0
  1122.                 End If
  1123.                 .Update
  1124.             End If
  1125.             
  1126.             Cw_DataEnvi.DataConnect.CommitTrans
  1127.             
  1128.             '刷新当前网格
  1129.             Sqlstr = "SELECT * FROM Tr_V_VehicleFile WHERE VehicleNum= '" + Trim(LrText(0).Text) + "'"
  1130.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1131.             
  1132.             If Not Cxnrrec.EOF Then
  1133.                 With CzxsGrid
  1134.                     Call Jltcwg(Cxnrrec, .Row)
  1135.                 End With
  1136.             Else
  1137.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  1138.                 Call Xtxxts(Tsxx, 0, 4)
  1139.                 Exit Function
  1140.             End If
  1141.         End If
  1142.      
  1143.         '保存记录成功,函数返回真值
  1144.         Bclrsj = True
  1145.         Exit Function
  1146.     End With
  1147.  
  1148. Swcwcl:
  1149. '
  1150.     If Err.Number = -2147217887 Then
  1151.       Cw_DataEnvi.DataConnect.RollbackTrans
  1152.       Tsxx = "数值录入不规范!"
  1153.       Call Xtxxts(Tsxx, 0, 1)
  1154.       Set Rec_CodeSet = Nothing
  1155.       Exit Function
  1156.     Else
  1157.       Cw_DataEnvi.DataConnect.RollbackTrans
  1158.       Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
  1159.       Call Xtxxts(Tsxx, 0, 1)
  1160.       Exit Function
  1161.     End If
  1162. End Function
  1163. Private Function Cshlrxx(lrztxx As Integer) As Boolean              '初始化录入字段信息
  1164.     TextChangeLock = True       '关闭文本框Chang事件
  1165.     
  1166.     If lrztxx = 1 Then
  1167.     
  1168.         '增加新记录时将文本框清空
  1169.         For jsqte = 0 To Max_Text_Index
  1170.             If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  1171.                 LrText(jsqte).Text = ""
  1172.                 LrText(jsqte).Tag = ""
  1173.             End If
  1174.             TextValiJudgeLock(jsqte) = True
  1175.         Next jsqte
  1176.         
  1177.         '[>>
  1178.         '在此处可添加新增记录时初始化设置
  1179. '        Chk_Scrap.Value = 0
  1180. '        StopFlag = 1
  1181.         '<<]
  1182.     Else
  1183.     
  1184.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  1185.         With RecTemp
  1186.         
  1187.             Sqlstr = "SELECT Tr_V_VehicleFile.* FROM Tr_V_VehicleFile Where VehicleNum='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), szzls))) & "'"
  1188.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1189.        
  1190.             '记录如存在则读入其内容,否则提示记录已被其他人删除
  1191.             If Not RecTemp.EOF Then
  1192.                 LrText(0).Text = Trim(.Fields("VehicleNum") & "")                '车号
  1193.                 LrText(1).Text = Trim(.Fields("TypeName") & "")                  '车辆类型
  1194.                 LrText(1).Tag = Trim(.Fields("TypeCode") & "")
  1195.                 LrText(2).Text = Trim(.Fields("NowGradeName") & "")              '车辆等级
  1196.                 LrText(2).Tag = Trim(.Fields("NowGradeCode") & "")
  1197.                 LrText(3).Text = Trim(.Fields("UseNatureName") & "")             '车辆使用性质
  1198.                 LrText(3).Tag = Trim(.Fields("UseNatureCode") & "")
  1199.                 LrText(4).Text = Trim(.Fields("SituationName") & "")             '车辆状况
  1200.                 LrText(4).Tag = Trim(.Fields("SituationCode") & "")
  1201.                 LrText(5).Text = Trim(.Fields("OwnerShipName") & "")             '车辆所有权
  1202.                 LrText(5).Tag = Trim(.Fields("OwnerShipCode") & "")
  1203.                 If .Fields("SelfWeight") <> 0 Then                                                                          '自重
  1204.                     LrText(6).Text = .Fields("SelfWeight")
  1205.                 Else
  1206.                     LrText(6).Text = ""
  1207.                 End If
  1208.                 If .Fields("LoadWeight") <> 0 Then                                                                          '载重
  1209.                     LrText(7).Text = .Fields("LoadWeight")
  1210.                 Else
  1211.                     LrText(7).Text = ""
  1212.                 End If
  1213.                 If .Fields("FormerValue") <> 0 Then                                                                         '原值
  1214.                     LrText(8).Text = .Fields("FormerValue")
  1215.                 Else
  1216.                     LrText(8).Text = ""
  1217.                 End If
  1218.          
  1219.                 If .Fields("YearOld") <> 0 Then                                                                             '年折旧率
  1220.                     LrText(9).Text = .Fields("YearOld")
  1221.                 Else
  1222.                     LrText(9).Text = ""
  1223.                 End If
  1224.                 
  1225.                 If Not IsNull(.Fields("Outdays")) Then                                                                        '出厂日期
  1226.                     LrText(10).Text = Format(Trim(.Fields("Outdays")), "yyyy-mm-dd")
  1227.                 Else
  1228.                     LrText(10).Text = ""
  1229.                 End If
  1230.            
  1231.                 If .Fields("UseYear") <> 0 Then                                                                             '使用年限
  1232.                     LrText(11).Text = .Fields("UseYear")
  1233.                 Else
  1234.                     LrText(11).Text = ""
  1235.                 End If
  1236.             
  1237.                 If Not IsNull(.Fields("MadeIn")) Then                                                                         '制造单位
  1238.                     LrText(12).Text = Trim(.Fields("MadeIn") & "")
  1239.                 Else
  1240.                     LrText(12).Text = ""
  1241.                 End If
  1242.     
  1243.                 If Not IsNull(.Fields("RightUnit")) Then                                                                      '产权单位
  1244.                     LrText(13).Text = Trim(.Fields("RightUnit") & "")
  1245.                 Else
  1246.                     LrText(13).Text = ""
  1247.                 End If
  1248.                 
  1249.                 If Not IsNull(.Fields("Remark")) Then                                                                         '备注
  1250.                     LrText(14).Text = Trim(.Fields("Remark") & "")
  1251.                 Else
  1252.                     LrText(14).Text = ""
  1253.                 End If
  1254.           
  1255.             
  1256.                 Chk_Scrap.Enabled = True
  1257.                 If .Fields("IfScrap") Then                                                                                  '停用标记
  1258.                    StopFlag = 1
  1259.                    Chk_Scrap.Value = 1
  1260.                    StopFlag = 0
  1261.                 Else
  1262.                    StopFlag = 1
  1263.                    Chk_Scrap.Value = 0
  1264.                    StopFlag = 0
  1265.                 End If
  1266.             Else
  1267.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  1268.                 Call Xtxxts(Tsxx, 0, 4)
  1269.                 Call Cancel
  1270.                 TextChangeLock = False
  1271.                 Exit Function
  1272.             End If
  1273.             
  1274.         End With
  1275.         
  1276.     End If
  1277.     
  1278.     Cshlrxx = True
  1279.     TextChangeLock = False
  1280.     
  1281. End Function
  1282. Private Sub Scdqjl()                 '删 除 当 前 记 录
  1283.     Dim yhAnswer As Integer
  1284.     
  1285.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1286.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1287.         Exit Sub
  1288.     End If
  1289.     
  1290.     '非数据行不能删除
  1291.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1292.         Exit Sub
  1293.     End If
  1294.   
  1295.     '用户确认是否删除记录
  1296.     Tsxx = "请确认是否删除当前记录?"
  1297.     yhAnswer = Xtxxts(Tsxx, 2, 2)
  1298.     
  1299.     If yhAnswer = 2 Then
  1300.         Exit Sub
  1301.     End If
  1302.   
  1303.     On Error GoTo Cwcl
  1304.   
  1305.     Cw_DataEnvi.DataConnect.BeginTrans
  1306.   
  1307.     '[以下需自定义部分
  1308.     Cw_DataEnvi.DataConnect.Execute "delete Tr_VehicleFile where VehicleNum = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), szzls))) + "'"
  1309.     '以上为自定义部分]
  1310.   
  1311.     Cw_DataEnvi.DataConnect.CommitTrans
  1312.     
  1313.     CzxsGrid.RemoveItem CzxsGrid.Row
  1314.   
  1315.     Exit Sub
  1316.   
  1317. Cwcl:
  1318.     Cw_DataEnvi.DataConnect.RollbackTrans
  1319.     
  1320.     If Err.Number = -2147217873 Then              '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  1321.         Tsxx = "此车已经被使用,不能删除!"
  1322.         Call Xtxxts(Tsxx, 0, 1)
  1323.         Exit Sub
  1324.     Else
  1325.         Tsxx = "出现未知情况,该编码不能被删除!"
  1326.         Call Xtxxts(Tsxx, 0, 1)
  1327.         Exit Sub
  1328.     End If
  1329.     
  1330. End Sub
  1331. '*******************以下区域为编写自定义过程区域**********************
  1332. '*******************以上区域为编写自定义过程区域**********************
  1333. '*******************************以下为基本处理程序(固定不变)*******************************************'
  1334. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1335.     If Shift = 2 Then
  1336.         Select Case UCase(Chr(KeyCode))
  1337.             Case "P"                                                                          'Ctrl+P 打印
  1338.                 If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  1339.                     Call bbyl(False)
  1340.                 End If
  1341.             Case "A"                                                                          'Ctrl+A 增加
  1342.                 '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1343.                 If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1344.                     Exit Sub
  1345.                 End If
  1346.                 If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
  1347.                     Call Toolbjzt
  1348.                     Lrzt = 1
  1349.                     Call Cshlrxx(Lrzt)
  1350.                     For jsqte = 0 To Max_Text_Index
  1351.                         LrText(jsqte).Enabled = True
  1352.                         If Textboolean(jsqte, 1) Then
  1353.                            Ydcommand1(jsqte).Enabled = True
  1354.                         End If
  1355.                     Next jsqte
  1356.                     LrText(0).Enabled = True
  1357.                     LrText(0).SetFocus
  1358.                 End If
  1359.             Case "D"                                                                          'Ctrl+D 删除
  1360.                 If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
  1361.                     Call Scdqjl
  1362.                 End If
  1363.         End Select
  1364.     End If
  1365.   
  1366. End Sub
  1367. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1368.     Select Case Button.Key
  1369.         Case "ymsz"                                          '页面设置
  1370.             Dyymctbl.Show 1
  1371.         Case "yl"                                            '预 览
  1372.             Call bbyl(True)
  1373.         Case "dy"                                            '打 印
  1374.              Call bbyl(False)
  1375.         Case "zj"                                            '增 加
  1376.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1377.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1378.                 Exit Sub
  1379.             End If
  1380.             Call Toolbjzt
  1381.             Lrzt = 1
  1382.             Call Cshlrxx(Lrzt)
  1383.             For jsqte = 0 To Max_Text_Index
  1384.                 LrText(jsqte).Enabled = True
  1385.                 If Textboolean(jsqte, 1) Then
  1386.                   Ydcommand1(jsqte).Enabled = True
  1387.                 End If
  1388.             Next jsqte
  1389.             LrText(0).SetFocus
  1390.         Case "xg"                                            '修 改
  1391.             Call Xgdqjl
  1392.         Case "sc"                                            '删 除
  1393.             Call Scdqjl
  1394.         Case "sx"                                            '刷 新
  1395.             Call Cxnrtcwg
  1396.         Case "bz"                                            '帮 助
  1397.             Call F1bz
  1398.         Case "fh"                                            '退 出
  1399.             Unload Me
  1400.     End Select
  1401.     
  1402. End Sub
  1403. Private Sub CzxsGrid_DblClick()                                         '修改当前编码记录
  1404.     Call Xgdqjl
  1405.     
  1406. End Sub
  1407. Private Sub Xgdqjl()                                                    '修改当前编码记录
  1408.     Dim Findrec As New ADODB.Recordset
  1409.     Dim Sqlstr As String
  1410.     
  1411.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1412.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
  1413.         BcCommand.Enabled = False
  1414.     End If
  1415.         
  1416.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1417.         Exit Sub
  1418.     End If
  1419.     
  1420.     Call Toolbjzt
  1421.     Lrzt = 2
  1422.     
  1423.     If Cshlrxx(Lrzt) Then
  1424.         Sqlstr = "SELECT Tr_V_VehicleFile.* FROM Tr_V_VehicleFile Where VehicleNum='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), szzls))) & "'and ifscrap=1"
  1425.         Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1426.         If Findrec.EOF Then
  1427.             For jsqte = 0 To Max_Text_Index
  1428.                 LrText(jsqte).Enabled = True
  1429.                 If Textboolean(jsqte, 1) Then
  1430.                   Ydcommand1(jsqte).Enabled = True
  1431.                 End If
  1432.             Next jsqte
  1433.             LrText(1).SetFocus
  1434.             LrText(0).Enabled = False
  1435.         Else
  1436.             For jsqte = 0 To Max_Text_Index
  1437.                 LrText(jsqte).Enabled = False
  1438.                 If Textboolean(jsqte, 1) Then
  1439.                   Ydcommand1(jsqte).Enabled = False
  1440.                 End If
  1441.             Next jsqte
  1442.         End If
  1443.     End If
  1444.   
  1445. End Sub
  1446. Private Sub Toolbjzt()                                                  'Toolbar状态(编辑状态)
  1447.     StTab.TabEnabled(1) = True
  1448.     StTab.Tab = 1
  1449.     Frame1.Enabled = True
  1450.     StTab.TabEnabled(0) = False
  1451.     CzxsGrid.Enabled = False
  1452.     
  1453.     With SzToolbar
  1454.         .Buttons("ymsz").Enabled = False
  1455.         .Buttons("dy").Enabled = False
  1456.         .Buttons("yl").Enabled = False
  1457.         .Buttons("zj").Enabled = False
  1458.         .Buttons("xg").Enabled = False
  1459.         .Buttons("sc").Enabled = False
  1460.         .Buttons("sx").Enabled = False
  1461.     End With
  1462.   
  1463. End Sub
  1464. Private Sub Toolfbjzt()                                                 'Toolbar状态(非编辑状态)
  1465.     StTab.TabEnabled(0) = True
  1466.     StTab.Tab = 0
  1467.     CzxsGrid.Enabled = True
  1468.     Frame1.Enabled = False
  1469.     StTab.TabEnabled(1) = False
  1470.     Lrzt = 0
  1471.     
  1472.     With SzToolbar
  1473.         .Buttons("ymsz").Enabled = True
  1474.         .Buttons("dy").Enabled = True
  1475.         .Buttons("yl").Enabled = True
  1476.         .Buttons("zj").Enabled = True
  1477.         .Buttons("xg").Enabled = True
  1478.         .Buttons("sc").Enabled = True
  1479.         .Buttons("sx").Enabled = True
  1480.     End With
  1481.   
  1482. End Sub
  1483. Private Sub BcCommand_Click()                                           '保 存
  1484.     If Not Bclrsj Then
  1485.         Exit Sub
  1486.     End If
  1487.     
  1488.     If Lrzt = 2 Then
  1489.         Call Toolfbjzt
  1490.     End If
  1491.   
  1492. End Sub
  1493. Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)       '取消
  1494.   
  1495.     '避免执行Click程序
  1496.     Bln_Cancel = True
  1497.     
  1498.     Call Cancel
  1499.   
  1500. End Sub
  1501. Private Sub QxCommand_Click()                                           '取消
  1502.     If Bln_Cancel Then
  1503.         Bln_Cancel = False
  1504.         Exit Sub
  1505.     End If
  1506.     
  1507.     Call Cancel
  1508.     
  1509. End Sub
  1510. Private Sub Cancel()                                                    '取消
  1511.     '文本框加锁
  1512.     For jsqte = 0 To Max_Text_Index
  1513.         TextValiJudgeLock(jsqte) = True
  1514.     Next jsqte
  1515.     
  1516.     Call Toolfbjzt
  1517.   
  1518. End Sub
  1519. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  1520.   
  1521.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  1522.   
  1523. End Sub
  1524. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1525.     Select Case Button.Key
  1526.         Case "bcgs"                                       '保存表格格式
  1527.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1528.         Case "hfmrgs"                                     '恢复默认格式
  1529.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1530.         Case "szxsxm"                                     '设置显示项目
  1531.             Call Szxsxm(CzxsGrid, GridCode)
  1532.     End Select
  1533.     
  1534. End Sub
  1535. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1536.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1537.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1538.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1539.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1540.     ReDim Bbxbt(1 To Bbxbtgs)
  1541.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1542.     
  1543.     If Bbbwhgs <> 0 Then
  1544.         ReDim Bbbwh(1 To Bbbwhgs)
  1545.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1546.     End If
  1547.     
  1548.     Bbzbt = ReportTitle
  1549.     Bbxbt(1) = " "
  1550.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1551.   
  1552.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1553.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1554.     
  1555.     If Not bbylte Then
  1556.         Unload DY_Tybbyldy
  1557.     End If
  1558.     
  1559. End Sub
  1560. '************以下为文本框录入处理程序(固定不变部分)*************'
  1561. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1562.   
  1563.     '以下为依据实际情况自定义部分[
  1564.     
  1565.         '在此填写文本框录入事后处理程序
  1566.      
  1567.     ']以上为依据实际情况自定义部分
  1568.   
  1569. End Sub
  1570. Private Sub LrText_Change(Index As Integer)
  1571.     '屏蔽程序改变控制
  1572.     If TextChangeLock Then
  1573.         Exit Sub
  1574.     End If
  1575.     
  1576.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  1577.     
  1578.     '限制字段录入长度
  1579.           
  1580.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  1581.      
  1582.     Select Case Textint(Index, 1)
  1583.         Case 8, 11       '金额型
  1584.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  1585.         Case 9, 12       '数量型
  1586.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  1587.         Case 10          '单价型
  1588.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1589.         Case Else        '其他小数类型控制
  1590.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  1591.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  1592.             End If
  1593.     End Select
  1594.         
  1595.     TextChangeLock = False '解锁
  1596.    
  1597. End Sub
  1598. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  1599.    
  1600.     Call TextShow(Index)
  1601.     CurTextIndex = Index
  1602.     LrText(Index).SelStart = Len(LrText(Index))
  1603.    
  1604. End Sub
  1605. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  1606.    
  1607.     Select Case KeyCode
  1608.         Case vbKeyF2
  1609.             Call Text_Help(Index)
  1610.     End Select
  1611.    
  1612. End Sub
  1613. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  1614.    
  1615.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  1616. End Sub
  1617. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  1618.     '显示相应信息但不能进行有效性判断
  1619.   
  1620. End Sub
  1621. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  1622.    
  1623.     Call Text_Help(Index)
  1624.     
  1625. End Sub
  1626. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  1627.   
  1628.     If Not Textboolean(Index, 1) Then
  1629.         Exit Sub
  1630.     End If
  1631.      
  1632.     '调用帮助
  1633.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  1634.   
  1635.     '根据设置选择显示编码和名称,并进行存储
  1636.     If Len(Xtfhcs) <> 0 Then
  1637.         If Textint(Index, 3) = 1 Then
  1638.             LrText(Index).Text = Xtfhcsfz
  1639.             LrText(Index).Tag = Xtfhcs
  1640.         Else
  1641.             LrText(Index).Text = Xtfhcs
  1642.             LrText(Index).Tag = Xtfhcsfz
  1643.         End If
  1644.     End If
  1645.    
  1646.     LrText(Index).SetFocus
  1647.     
  1648. End Sub
  1649. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1650.     '填写文本框得到焦点,进行相应信息处理程序
  1651.    
  1652. End Sub
  1653. Private Sub Wbkcsh()                          '录入文本框初始化
  1654.     Dim jsqte As Long
  1655.   
  1656.     '最大录入文本框索引值
  1657.     Max_Text_Index = Textvar(1)
  1658.   
  1659.     ReDim TextValiJudgeLock(Max_Text_Index)
  1660.   
  1661.     For jsqte = 0 To Max_Text_Index
  1662.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  1663.             If Textboolean(jsqte, 1) Then
  1664.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  1665.                     Load Ydcommand1(jsqte)
  1666.                 End If
  1667.                 Ydcommand1(jsqte).Visible = True
  1668.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  1669.             End If
  1670.             
  1671.             TextChangeLock = True
  1672.             LrText(jsqte).Text = ""
  1673.             LrText(jsqte).Tag = ""
  1674.             
  1675.             If Textint(jsqte, 5) <> 0 Then
  1676.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  1677.             End If
  1678.             
  1679.             TextChangeLock = False
  1680.         End If
  1681.        
  1682.         TextValiJudgeLock(jsqte) = True
  1683.     Next jsqte
  1684.     
  1685. End Sub
  1686. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  1687.     Dim Sqlstr As String
  1688.     Dim Findrec As ADODB.Recordset
  1689.   
  1690.     '文本框内容未曾改变不进行有效性判断
  1691.     If TextValiJudgeLock(Index) Then
  1692.         TextYxxpd = True
  1693.         Exit Function
  1694.     End If
  1695.   
  1696.     '文本框内容为空认为有效,并清空其Tag值
  1697.     If Trim(LrText(Index)) = "" Then
  1698.         LrText(Index).Tag = ""
  1699.         Call Wbklrwbcl(Index)
  1700.         TextValiJudgeLock(Index) = True
  1701.         TextYxxpd = True
  1702.         Exit Function
  1703.     End If
  1704.   
  1705.     '可在此加入不做有效性判断的理由
  1706.     Select Case Textint(Index, 4)
  1707.         Case 1      '编码型
  1708.             Sqlstr = Trim(Textstr(Index, 5))
  1709.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  1710.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1711.             
  1712.             If Findrec.EOF Then
  1713.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  1714.                 LrText(Index).SetFocus
  1715.                 Exit Function
  1716.             Else
  1717.                 Select Case Textint(Index, 3)
  1718.                     Case 0
  1719.                     
  1720.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1721.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1722.                         End If
  1723.                         
  1724.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1725.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1726.                         End If
  1727.                         
  1728.                     Case 1
  1729.                     
  1730.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1731.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1732.                         End If
  1733.                         
  1734.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1735.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1736.                         End If
  1737.                 End Select
  1738.             End If
  1739.             
  1740.         Case 2      '日期型
  1741.             If IsDate(LrText(Index).Text) Then
  1742.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  1743.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  1744.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  1745.                 End If
  1746.             Else
  1747.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  1748.                 Call Xtxxts(Tsxx, 0, 1)
  1749.                 LrText(Index).SetFocus
  1750.                 Exit Function
  1751.             End If
  1752.             
  1753.         Case 3      '其他类型
  1754.             If Index = 0 Then
  1755.                 If Len(LrText(Index).Text) <> 7 And Len(LrText(Index).Text) <> 8 Then
  1756.                      Tsxx = "车号只能是7位或8位数字或字符!"
  1757.                      Call Xtxxts(Tsxx, 0, 1)
  1758.                      LrText(Index).SetFocus
  1759.                      Exit Function
  1760.                 End If
  1761.             End If
  1762.         
  1763.     End Select
  1764.     
  1765.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  1766.     TextValiJudgeLock(Index) = True
  1767.     '调用文本框事后处理程序
  1768.     Call Wbklrwbcl(Index)
  1769.    
  1770.     '有效性判断通过则返回True
  1771.     TextYxxpd = True
  1772.    
  1773. End Function