frmcarSGlr.frm
上传用户:naidiweb
上传日期:2013-08-15
资源大小:672k
文件大小:24k
开发平台:

WORD

  1. VERSION 5.00
  2. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  3. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  4. Begin VB.Form frmcarSGlr 
  5.    Caption         =   "车辆事故列表"
  6.    ClientHeight    =   3030
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   10155
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   3030
  13.    ScaleWidth      =   10155
  14.    Begin VB.Frame Frame1 
  15.       Caption         =   "车辆事故记录"
  16.       Height          =   2520
  17.       Left            =   90
  18.       TabIndex        =   6
  19.       Top             =   90
  20.       Width           =   10005
  21.       Begin VB.TextBox Text3 
  22.          DataField       =   "车辆类型"
  23.          DataSource      =   "Adodc1"
  24.          Height          =   270
  25.          Left            =   1320
  26.          TabIndex        =   41
  27.          Top             =   990
  28.          Width           =   1605
  29.       End
  30.       Begin MSAdodcLib.Adodc Adodc2 
  31.          Height          =   330
  32.          Left            =   7380
  33.          Top             =   1695
  34.          Visible         =   0   'False
  35.          Width           =   2415
  36.          _ExtentX        =   4260
  37.          _ExtentY        =   582
  38.          ConnectMode     =   0
  39.          CursorLocation  =   3
  40.          IsolationLevel  =   -1
  41.          ConnectionTimeout=   15
  42.          CommandTimeout  =   30
  43.          CursorType      =   3
  44.          LockType        =   3
  45.          CommandType     =   1
  46.          CursorOptions   =   0
  47.          CacheSize       =   50
  48.          MaxRecords      =   0
  49.          BOFAction       =   0
  50.          EOFAction       =   0
  51.          ConnectStringType=   1
  52.          Appearance      =   1
  53.          BackColor       =   -2147483643
  54.          ForeColor       =   -2147483640
  55.          Orientation     =   0
  56.          Enabled         =   -1
  57.          Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  58.          OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  59.          OLEDBFile       =   ""
  60.          DataSourceName  =   ""
  61.          OtherAttributes =   ""
  62.          UserName        =   ""
  63.          Password        =   ""
  64.          RecordSource    =   "select * from 车辆类型表"
  65.          Caption         =   "Adodc2"
  66.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  67.             Name            =   "宋体"
  68.             Size            =   9
  69.             Charset         =   134
  70.             Weight          =   400
  71.             Underline       =   0   'False
  72.             Italic          =   0   'False
  73.             Strikethrough   =   0   'False
  74.          EndProperty
  75.          _Version        =   393216
  76.       End
  77.       Begin VB.TextBox Text1 
  78.          DataField       =   "事故编号"
  79.          DataSource      =   "Adodc1"
  80.          Enabled         =   0   'False
  81.          Height          =   270
  82.          Left            =   1320
  83.          TabIndex        =   19
  84.          ToolTipText     =   "格式为日期“20040508”是有效格式!"
  85.          Top             =   240
  86.          Width           =   1605
  87.       End
  88.       Begin VB.TextBox Text2 
  89.          DataField       =   "车牌号码"
  90.          DataSource      =   "Adodc1"
  91.          Enabled         =   0   'False
  92.          Height          =   270
  93.          Left            =   1320
  94.          TabIndex        =   18
  95.          Top             =   630
  96.          Width           =   1605
  97.       End
  98.       Begin VB.TextBox Text5 
  99.          DataField       =   "事故概要"
  100.          DataSource      =   "Adodc1"
  101.          Enabled         =   0   'False
  102.          Height          =   270
  103.          Left            =   1320
  104.          TabIndex        =   17
  105.          Top             =   1692
  106.          Width           =   1605
  107.       End
  108.       Begin VB.TextBox Text6 
  109.          DataField       =   "事故确认者"
  110.          DataSource      =   "Adodc1"
  111.          Enabled         =   0   'False
  112.          Height          =   270
  113.          Left            =   1320
  114.          TabIndex        =   16
  115.          Top             =   2055
  116.          Width           =   1605
  117.       End
  118.       Begin VB.TextBox Text7 
  119.          DataField       =   "公司负担金"
  120.          DataSource      =   "Adodc1"
  121.          Enabled         =   0   'False
  122.          Height          =   270
  123.          Left            =   4350
  124.          TabIndex        =   15
  125.          Top             =   270
  126.          Width           =   1605
  127.       End
  128.       Begin VB.TextBox Text8 
  129.          DataField       =   "保险理赔金"
  130.          DataSource      =   "Adodc1"
  131.          Enabled         =   0   'False
  132.          Height          =   270
  133.          Left            =   4350
  134.          TabIndex        =   14
  135.          Top             =   630
  136.          Width           =   1605
  137.       End
  138.       Begin VB.TextBox Text9 
  139.          DataField       =   "对方赔偿金"
  140.          DataSource      =   "Adodc1"
  141.          Enabled         =   0   'False
  142.          Height          =   270
  143.          Left            =   4350
  144.          TabIndex        =   13
  145.          Top             =   990
  146.          Width           =   1605
  147.       End
  148.       Begin VB.TextBox Text10 
  149.          DataField       =   "对方姓名"
  150.          DataSource      =   "Adodc1"
  151.          Enabled         =   0   'False
  152.          Height          =   270
  153.          Left            =   4350
  154.          TabIndex        =   12
  155.          Top             =   1350
  156.          Width           =   1605
  157.       End
  158.       Begin VB.TextBox Text11 
  159.          DataField       =   "对方住址"
  160.          DataSource      =   "Adodc1"
  161.          Enabled         =   0   'False
  162.          Height          =   270
  163.          Left            =   4350
  164.          TabIndex        =   11
  165.          Top             =   1710
  166.          Width           =   1605
  167.       End
  168.       Begin VB.TextBox Text12 
  169.          DataField       =   "对方所在单位"
  170.          DataSource      =   "Adodc1"
  171.          Enabled         =   0   'False
  172.          Height          =   270
  173.          Left            =   4350
  174.          TabIndex        =   10
  175.          Top             =   2070
  176.          Width           =   5475
  177.       End
  178.       Begin VB.TextBox Text13 
  179.          DataField       =   "对方损坏程度"
  180.          DataSource      =   "Adodc1"
  181.          Enabled         =   0   'False
  182.          Height          =   675
  183.          Left            =   7380
  184.          MultiLine       =   -1  'True
  185.          ScrollBars      =   2  'Vertical
  186.          TabIndex        =   9
  187.          Top             =   270
  188.          Width           =   2520
  189.       End
  190.       Begin VB.TextBox Text14 
  191.          DataField       =   "和解内容"
  192.          DataSource      =   "Adodc1"
  193.          Enabled         =   0   'False
  194.          Height          =   675
  195.          Left            =   7380
  196.          MultiLine       =   -1  'True
  197.          ScrollBars      =   2  'Vertical
  198.          TabIndex        =   8
  199.          Top             =   1125
  200.          Width           =   2520
  201.       End
  202.       Begin VB.TextBox TextDTP 
  203.          DataField       =   "事故时间"
  204.          DataSource      =   "Adodc1"
  205.          Height          =   270
  206.          Left            =   1320
  207.          TabIndex        =   7
  208.          Top             =   1335
  209.          Width           =   1605
  210.       End
  211.       Begin MSComCtl2.DTPicker DTPicker1 
  212.          Height          =   270
  213.          Left            =   1305
  214.          TabIndex        =   20
  215.          Top             =   1335
  216.          Width           =   1605
  217.          _ExtentX        =   2831
  218.          _ExtentY        =   476
  219.          _Version        =   393216
  220.          Enabled         =   0   'False
  221.          Format          =   26935297
  222.          CurrentDate     =   38323
  223.       End
  224.       Begin VB.Label Label1 
  225.          Caption         =   "事故编号:"
  226.          Height          =   315
  227.          Left            =   285
  228.          TabIndex        =   40
  229.          Top             =   270
  230.          Width           =   1305
  231.       End
  232.       Begin VB.Label Label2 
  233.          Caption         =   "车牌号码:"
  234.          Height          =   315
  235.          Left            =   285
  236.          TabIndex        =   39
  237.          Top             =   630
  238.          Width           =   1305
  239.       End
  240.       Begin VB.Label Label3 
  241.          Caption         =   "车辆类型:"
  242.          Height          =   315
  243.          Left            =   285
  244.          TabIndex        =   38
  245.          Top             =   990
  246.          Width           =   1305
  247.       End
  248.       Begin VB.Label Label4 
  249.          Caption         =   "事故时间:"
  250.          Height          =   315
  251.          Left            =   285
  252.          TabIndex        =   37
  253.          Top             =   1350
  254.          Width           =   1305
  255.       End
  256.       Begin VB.Label Label5 
  257.          Caption         =   "事故概要:"
  258.          Height          =   315
  259.          Index           =   0
  260.          Left            =   270
  261.          TabIndex        =   36
  262.          Top             =   1710
  263.          Width           =   1305
  264.       End
  265.       Begin VB.Label Label6 
  266.          Caption         =   "事故确认者:"
  267.          Height          =   315
  268.          Left            =   270
  269.          TabIndex        =   35
  270.          Top             =   2070
  271.          Width           =   1305
  272.       End
  273.       Begin VB.Label Label7 
  274.          Caption         =   "公司负担金:"
  275.          Height          =   315
  276.          Left            =   3015
  277.          TabIndex        =   34
  278.          Top             =   270
  279.          Width           =   1305
  280.       End
  281.       Begin VB.Label Label8 
  282.          Caption         =   "保险理赔金:"
  283.          Height          =   315
  284.          Left            =   3015
  285.          TabIndex        =   33
  286.          Top             =   630
  287.          Width           =   1305
  288.       End
  289.       Begin VB.Label Label9 
  290.          Caption         =   "对方赔偿金:"
  291.          Height          =   315
  292.          Left            =   3015
  293.          TabIndex        =   32
  294.          Top             =   990
  295.          Width           =   1305
  296.       End
  297.       Begin VB.Label Label10 
  298.          Caption         =   "对方姓名:"
  299.          Height          =   315
  300.          Left            =   3015
  301.          TabIndex        =   31
  302.          Top             =   1350
  303.          Width           =   1305
  304.       End
  305.       Begin VB.Label Label11 
  306.          Caption         =   "对方住址:"
  307.          Height          =   315
  308.          Left            =   3015
  309.          TabIndex        =   30
  310.          Top             =   1710
  311.          Width           =   1305
  312.       End
  313.       Begin VB.Label Label12 
  314.          Caption         =   "对方所在单位:"
  315.          Height          =   315
  316.          Left            =   3015
  317.          TabIndex        =   29
  318.          Top             =   2070
  319.          Width           =   1305
  320.       End
  321.       Begin VB.Label Label13 
  322.          Caption         =   "对方破坏程度:"
  323.          Height          =   315
  324.          Left            =   6150
  325.          TabIndex        =   28
  326.          Top             =   285
  327.          Width           =   1305
  328.       End
  329.       Begin VB.Label Label14 
  330.          Caption         =   "和解内容:"
  331.          Height          =   315
  332.          Left            =   6150
  333.          TabIndex        =   27
  334.          Top             =   1005
  335.          Width           =   1305
  336.       End
  337.       Begin VB.Label Label5 
  338.          Caption         =   "*"
  339.          ForeColor       =   &H000000FF&
  340.          Height          =   210
  341.          Index           =   2
  342.          Left            =   1155
  343.          TabIndex        =   26
  344.          Top             =   255
  345.          Width           =   150
  346.       End
  347.       Begin VB.Label Label5 
  348.          Caption         =   "*"
  349.          ForeColor       =   &H000000FF&
  350.          Height          =   135
  351.          Index           =   1
  352.          Left            =   1170
  353.          TabIndex        =   25
  354.          Top             =   630
  355.          Width           =   255
  356.       End
  357.       Begin VB.Label Label5 
  358.          Caption         =   "*"
  359.          ForeColor       =   &H000000FF&
  360.          Height          =   135
  361.          Index           =   3
  362.          Left            =   1155
  363.          TabIndex        =   24
  364.          Top             =   1380
  365.          Width           =   255
  366.       End
  367.       Begin VB.Label Label5 
  368.          Caption         =   "*"
  369.          ForeColor       =   &H000000FF&
  370.          Height          =   135
  371.          Index           =   4
  372.          Left            =   1155
  373.          TabIndex        =   23
  374.          Top             =   1740
  375.          Width           =   255
  376.       End
  377.       Begin VB.Label Label5 
  378.          Caption         =   "*"
  379.          ForeColor       =   &H000000FF&
  380.          Height          =   135
  381.          Index           =   5
  382.          Left            =   1155
  383.          TabIndex        =   22
  384.          Top             =   2100
  385.          Width           =   255
  386.       End
  387.       Begin VB.Label Label5 
  388.          Caption         =   "*"
  389.          ForeColor       =   &H000000FF&
  390.          Height          =   135
  391.          Index           =   6
  392.          Left            =   4140
  393.          TabIndex        =   21
  394.          Top             =   1410
  395.          Width           =   255
  396.       End
  397.    End
  398.    Begin VB.CommandButton cmdExit 
  399.       Caption         =   " 退 出(&E)"
  400.       Height          =   330
  401.       Left            =   9015
  402.       TabIndex        =   0
  403.       Top             =   2610
  404.       Width           =   1095
  405.    End
  406.    Begin MSAdodcLib.Adodc Adodc1 
  407.       Height          =   330
  408.       Left            =   3315
  409.       Top             =   2610
  410.       Width           =   3540
  411.       _ExtentX        =   6244
  412.       _ExtentY        =   582
  413.       ConnectMode     =   0
  414.       CursorLocation  =   3
  415.       IsolationLevel  =   -1
  416.       ConnectionTimeout=   15
  417.       CommandTimeout  =   30
  418.       CursorType      =   3
  419.       LockType        =   3
  420.       CommandType     =   1
  421.       CursorOptions   =   0
  422.       CacheSize       =   50
  423.       MaxRecords      =   0
  424.       BOFAction       =   0
  425.       EOFAction       =   0
  426.       ConnectStringType=   1
  427.       Appearance      =   1
  428.       BackColor       =   12632256
  429.       ForeColor       =   -2147483640
  430.       Orientation     =   0
  431.       Enabled         =   -1
  432.       Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  433.       OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  434.       OLEDBFile       =   ""
  435.       DataSourceName  =   ""
  436.       OtherAttributes =   ""
  437.       UserName        =   ""
  438.       Password        =   ""
  439.       RecordSource    =   "select * from 车辆事故表"
  440.       Caption         =   " 浏览事故记录"
  441.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  442.          Name            =   "宋体"
  443.          Size            =   9
  444.          Charset         =   134
  445.          Weight          =   400
  446.          Underline       =   0   'False
  447.          Italic          =   0   'False
  448.          Strikethrough   =   0   'False
  449.       EndProperty
  450.       _Version        =   393216
  451.    End
  452.    Begin VB.CommandButton cmdDelete 
  453.       Caption         =   "删 除(&D)"
  454.       Height          =   330
  455.       Left            =   2235
  456.       TabIndex        =   1
  457.       Top             =   2610
  458.       Width           =   1095
  459.    End
  460.    Begin VB.CommandButton cmdUpdate 
  461.       Caption         =   "修 改(&U)"
  462.       Height          =   330
  463.       Left            =   1155
  464.       TabIndex        =   2
  465.       Top             =   2610
  466.       Width           =   1095
  467.    End
  468.    Begin VB.CommandButton cmdCancel 
  469.       Caption         =   "取 消(&Q)"
  470.       Enabled         =   0   'False
  471.       Height          =   330
  472.       Left            =   7935
  473.       TabIndex        =   3
  474.       Top             =   2610
  475.       Width           =   1095
  476.    End
  477.    Begin VB.CommandButton cmdok 
  478.       Caption         =   "确 定(&O)"
  479.       Enabled         =   0   'False
  480.       Height          =   330
  481.       Left            =   6855
  482.       TabIndex        =   5
  483.       Top             =   2610
  484.       Width           =   1095
  485.    End
  486.    Begin VB.CommandButton cmdAdd 
  487.       Caption         =   "添 加(&A)"
  488.       Height          =   330
  489.       Left            =   75
  490.       TabIndex        =   4
  491.       Top             =   2610
  492.       Width           =   1095
  493.    End
  494. End
  495. Attribute VB_Name = "frmcarSGlr"
  496. Attribute VB_GlobalNameSpace = False
  497. Attribute VB_Creatable = False
  498. Attribute VB_PredeclaredId = True
  499. Attribute VB_Exposed = False
  500. Dim i As Integer
  501. Private Sub cmdAdd_Click()
  502.  Unlockctl
  503.     Text1 = "": Text2 = "": Text3 = "": Text5 = ""
  504.     Text6 = "": Text7 = "": Text8 = "": Text9 = ""
  505.     Text10 = "": Text11 = "": Text12 = "": Text13 = ""
  506.     Text14 = "": Text3 = "": Text1.SetFocus
  507.     cmdOk.Enabled = True: cmdCancel.Enabled = True
  508.     cmdUpdate.Enabled = False: cmdDelete.Enabled = False
  509.     DTPicker1.Visible = True
  510.     TextDTP.Visible = False: Adodc1.Enabled = False
  511.     i = 1
  512. End Sub
  513. Private Sub cmdCancel_Click()
  514.     On Error Resume Next     '当没有添加数据的时候 处理异常
  515.     Adodc1.Recordset.CancelUpdate
  516.     Adodc1.Refresh
  517.     Lockctl
  518.     cmdOk.Enabled = False: cmdCancel.Enabled = False
  519.     cmdAdd.Enabled = True: cmdUpdate.Enabled = True
  520.     cmdDelete.Enabled = True: DTPicker1.Visible = False
  521.     TextDTP.Visible = True: Adodc1.Enabled = True
  522. End Sub
  523. Private Sub cmdDelete_Click()
  524.     If MsgBox("您确实要删除记录吗?", vbOKCancel, "系统提示") = vbOK Then
  525.         adoCon.Execute ("delete from 车辆事故表 where 事故编号='" & Text1 & "'")
  526.         MsgBox " 记录已删除!", , "系统提示"
  527.         Adodc1.Refresh
  528.     End If
  529. End Sub
  530. Private Sub cmdExit_Click()
  531.     MDIForm1.StatusBar1.Panels(1).Text = ""
  532.     Unload Me
  533. End Sub
  534. Private Sub cmdOk_Click()
  535.    Select Case i
  536.          Case 1:
  537.                 If Text1.Text = "" Then
  538.                    MsgBox "事故编号不能为空!", , "系统提示"
  539.                    Exit Sub
  540.                 End If
  541.                 If Text2.Text = "" Then
  542.                    MsgBox "车牌号码不能为空!", , "系统提示"
  543.                    Text2.SetFocus: Exit Sub
  544.                  End If
  545.                 If Text5.Text = "" Then
  546.                    MsgBox "事故概要不能为空!", , "系统提示"
  547.                    Text5.SetFocus: Exit Sub
  548.                 End If
  549.                 If Text6.Text = "" Then
  550.                     MsgBox "事故确认者不能为空!!", , "系统提示"
  551.                     Text6.SetFocus: Exit Sub
  552.                  End If
  553.                 If Text10 = "" Then
  554.                    MsgBox "对方姓名不能为空!!", , "系统提示"
  555.                    Text10.SetFocus: Exit Sub
  556.                 End If
  557.                 adoCon.Execute ("insert into 车辆事故表 values ('" & Text1 & "','" & Text2 & "','" & Text3.Text & "','" & DTPicker1.Value & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text10 & "','" & Text11 & "','" & Text12 & "','" & Text13 & "','" & Text14 & "')")
  558.                 MsgBox "记录添加成功!", , "系统提示"
  559.                 Adodc1.Refresh
  560.           Case 2
  561.                  adoCon.Execute ("update 车辆事故表 set 车牌号码='" & Text2.Text & "',车辆类型='" & Text3.Text & "',事故时间='" & DTPicker1.Value & "',事故概要='" & Text5.Text & "',事故确认者='" & Text6.Text & "',公司负担金='" & Text7.Text & "',保险理赔金='" & Text8.Text & "',对方赔偿金='" & Text9.Text & "',对方姓名='" & Text10.Text & "',对方住址='" & Text11.Text & "',对方所在单位='" & Text12.Text & "',对方损坏程度='" & Text13.Text & "',和解内容='" & Text14.Text & "' where 事故编号='" & Text1.Text & "'")
  562.                  MsgBox "记录修改成功!", , "系统提示"
  563.                  Adodc1.Refresh
  564.   End Select
  565.     Lockctl
  566.     cmdOk.Enabled = False: cmdCancel.Enabled = False
  567.     cmdAdd.Enabled = True: cmdUpdate.Enabled = True
  568.     cmdDelete.Enabled = True: DTPicker1.Visible = False
  569.     TextDTP.Visible = True: Adodc1.Enabled = True
  570. End Sub
  571. Private Sub cmdUpdate_Click()
  572.     Unlockctl
  573.     cmdOk.Enabled = True: cmdCancel.Enabled = True
  574.     cmdAdd.Enabled = False: cmdDelete.Enabled = False
  575.     DTPicker1.Visible = True: TextDTP.Visible = False
  576.     Adodc1.Enabled = False: Text1.Enabled = False
  577.     i = 2
  578. End Sub
  579. Private Sub text3_KeyPress(KeyAscii As Integer)
  580.    KeyAscii = valiText(KeyAscii, Chr(13), True)
  581.    If KeyAscii = 13 Then
  582.       DTPicker1.SetFocus
  583.    End If
  584. End Sub
  585. Private Sub Form_Load()
  586.   frmcarSGlr.Width = 10350: frmcarSGlr.Height = 3435
  587. '  Adodc2.RecordSource = "select * from 车辆类型表"
  588. '  Adodc2.Refresh
  589. '  For i = 0 To Adodc2.Recordset.RecordCount - 1
  590. '      Text.AddItem Adodc2.Recordset.Fields(0).Value
  591. '      Adodc2.Recordset.MoveNext
  592. '  Next
  593. '  Combo1.Text = Adodc1.Recordset.Fields(2)
  594. End Sub
  595. Private Sub Lockctl()
  596.    Text1.Enabled = False: Text2.Enabled = False
  597.    Text3.Enabled = False: Text5.Enabled = False
  598.    Text6.Enabled = False: Text7.Enabled = False
  599.    Text8.Enabled = False: Text9.Enabled = False
  600.    Text10.Enabled = False: Text11.Enabled = False
  601.    Text12.Enabled = False: Text13.Enabled = False
  602.    Text14.Enabled = False: DTPicker1.Enabled = False: TextDTP.Enabled = False
  603. End Sub
  604. Private Sub Unlockctl()
  605.    Text1.Enabled = True: Text2.Enabled = True
  606.    Text3.Enabled = True: Text5.Enabled = True
  607.    Text6.Enabled = True: Text7.Enabled = True
  608.    Text8.Enabled = True: Text9.Enabled = True
  609.    Text10.Enabled = True: Text11.Enabled = True
  610.    Text12.Enabled = True: Text13.Enabled = True
  611.    Text14.Enabled = True: DTPicker1.Enabled = True: TextDTP.Enabled = True
  612. End Sub
  613. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
  614.   If KeyCode = vbKeyReturn Then
  615.      If Text1.Text = "" Then
  616.         MsgBox "不能为空,格式为日期“20040508”是有效格式!", , "系统提示"
  617.         Exit Sub
  618.      End If
  619.      Text2.SetFocus
  620.   End If
  621. End Sub
  622. Private Sub Text1_KeyPress(KeyAscii As Integer)
  623.  KeyAscii = valiText(KeyAscii, Chr(8) & "0123456789" & Chr(13), True)
  624. End Sub
  625. Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
  626.   If KeyCode = vbKeyReturn Then
  627.      If Text2.Text = "" Then
  628.         MsgBox "车牌号码不能为空!", , "系统提示"
  629.         Text2.SetFocus
  630.         Exit Sub
  631.      End If
  632.      Text3.SetFocus
  633.   End If
  634. End Sub
  635. Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
  636.   If KeyCode = vbKeyReturn Then Text5.SetFocus
  637. End Sub
  638. Private Sub Text2_LostFocus()
  639.   If Text2.Text = "" Then Exit Sub
  640.   Dim rss As New ADODB.Recordset
  641.   Set rss = adoCon.Execute("select * from 车辆档案 where 车牌号码='" & Text2.Text & "'")
  642.   If rss.EOF Then
  643.      MsgBox "这辆车不属于本公司的!", , "系统提示"
  644.      Text2.Text = ""
  645.      Text2.SetFocus
  646.      Exit Sub
  647.   Else
  648.      Text3.Text = rss.Fields(1).Value
  649.   End If
  650.   rss.Close
  651.   Dim rss1 As New ADODB.Recordset
  652.   Set rss1 = adoCon.Execute("select * from 车辆异动表 where 车牌号码='" & Text2.Text & "'")
  653.   If rss1.EOF = False Then
  654.      MsgBox "这辆车为异动车辆!", , "系统提示"
  655.      Text2.Text = ""
  656.      Text2.SetFocus
  657.      Exit Sub
  658.    End If
  659.    rss1.Close
  660. End Sub
  661. Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
  662.   If KeyCode = vbKeyReturn Then
  663.      If Text5.Text = "" Then
  664.         MsgBox "事故概要不能为空!", , "系统提示"
  665.         Text5.SetFocus
  666.         Exit Sub
  667.      End If
  668.      Text6.SetFocus
  669.   End If
  670. End Sub
  671. Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
  672.   If KeyCode = vbKeyReturn Then
  673.      If Text6.Text = "" Then
  674.          MsgBox "事故确认者不能为空!!", , "系统提示"
  675.          Text6.SetFocus
  676.          Exit Sub
  677.      End If
  678.      Text7.SetFocus
  679.   End If
  680. End Sub
  681. Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
  682.   If KeyCode = vbKeyReturn Then Text8.SetFocus
  683. End Sub
  684. Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
  685.   If KeyCode = vbKeyReturn Then Text9.SetFocus
  686. End Sub
  687. Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
  688.   If KeyCode = vbKeyReturn Then Text10.SetFocus
  689. End Sub
  690. Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
  691.   If KeyCode = vbKeyReturn Then
  692.      If Text10 = "" Then
  693.         MsgBox "对方姓名不能为空!!", , "系统提示"
  694.         Text10.SetFocus
  695.         Exit Sub
  696.      End If
  697.      Text11.SetFocus
  698.   End If
  699. End Sub
  700. Private Sub Text11_KeyDown(KeyCode As Integer, Shift As Integer)
  701.   If KeyCode = vbKeyReturn Then Text12.SetFocus
  702. End Sub
  703. Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
  704.   If KeyCode = vbKeyReturn Then Text13.SetFocus
  705. End Sub
  706. Private Sub Text13_KeyDown(KeyCode As Integer, Shift As Integer)
  707.   If KeyCode = vbKeyReturn Then Text14.SetFocus
  708. End Sub
  709. Private Sub Text14_KeyDown(KeyCode As Integer, Shift As Integer)
  710.   If KeyCode = vbKeyReturn Then cmdOk.SetFocus
  711. End Sub