frmcarSGlr.frm
资源名称:0123..rar [点击查看]
上传用户:naidiweb
上传日期:2013-08-15
资源大小:672k
文件大小:24k
源码类别:
软件设计/软件工程
开发平台:
WORD
- VERSION 5.00
- Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
- Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
- Begin VB.Form frmcarSGlr
- Caption = "车辆事故列表"
- ClientHeight = 3030
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 10155
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 3030
- ScaleWidth = 10155
- Begin VB.Frame Frame1
- Caption = "车辆事故记录"
- Height = 2520
- Left = 90
- TabIndex = 6
- Top = 90
- Width = 10005
- Begin VB.TextBox Text3
- DataField = "车辆类型"
- DataSource = "Adodc1"
- Height = 270
- Left = 1320
- TabIndex = 41
- Top = 990
- Width = 1605
- End
- Begin MSAdodcLib.Adodc Adodc2
- Height = 330
- Left = 7380
- Top = 1695
- Visible = 0 'False
- Width = 2415
- _ExtentX = 4260
- _ExtentY = 582
- ConnectMode = 0
- CursorLocation = 3
- IsolationLevel = -1
- ConnectionTimeout= 15
- CommandTimeout = 30
- CursorType = 3
- LockType = 3
- CommandType = 1
- CursorOptions = 0
- CacheSize = 50
- MaxRecords = 0
- BOFAction = 0
- EOFAction = 0
- ConnectStringType= 1
- Appearance = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
- OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = "select * from 车辆类型表"
- Caption = "Adodc2"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- _Version = 393216
- End
- Begin VB.TextBox Text1
- DataField = "事故编号"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 1320
- TabIndex = 19
- ToolTipText = "格式为日期“20040508”是有效格式!"
- Top = 240
- Width = 1605
- End
- Begin VB.TextBox Text2
- DataField = "车牌号码"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 1320
- TabIndex = 18
- Top = 630
- Width = 1605
- End
- Begin VB.TextBox Text5
- DataField = "事故概要"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 1320
- TabIndex = 17
- Top = 1692
- Width = 1605
- End
- Begin VB.TextBox Text6
- DataField = "事故确认者"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 1320
- TabIndex = 16
- Top = 2055
- Width = 1605
- End
- Begin VB.TextBox Text7
- DataField = "公司负担金"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 4350
- TabIndex = 15
- Top = 270
- Width = 1605
- End
- Begin VB.TextBox Text8
- DataField = "保险理赔金"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 4350
- TabIndex = 14
- Top = 630
- Width = 1605
- End
- Begin VB.TextBox Text9
- DataField = "对方赔偿金"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 4350
- TabIndex = 13
- Top = 990
- Width = 1605
- End
- Begin VB.TextBox Text10
- DataField = "对方姓名"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 4350
- TabIndex = 12
- Top = 1350
- Width = 1605
- End
- Begin VB.TextBox Text11
- DataField = "对方住址"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 4350
- TabIndex = 11
- Top = 1710
- Width = 1605
- End
- Begin VB.TextBox Text12
- DataField = "对方所在单位"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 270
- Left = 4350
- TabIndex = 10
- Top = 2070
- Width = 5475
- End
- Begin VB.TextBox Text13
- DataField = "对方损坏程度"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 675
- Left = 7380
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 9
- Top = 270
- Width = 2520
- End
- Begin VB.TextBox Text14
- DataField = "和解内容"
- DataSource = "Adodc1"
- Enabled = 0 'False
- Height = 675
- Left = 7380
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 8
- Top = 1125
- Width = 2520
- End
- Begin VB.TextBox TextDTP
- DataField = "事故时间"
- DataSource = "Adodc1"
- Height = 270
- Left = 1320
- TabIndex = 7
- Top = 1335
- Width = 1605
- End
- Begin MSComCtl2.DTPicker DTPicker1
- Height = 270
- Left = 1305
- TabIndex = 20
- Top = 1335
- Width = 1605
- _ExtentX = 2831
- _ExtentY = 476
- _Version = 393216
- Enabled = 0 'False
- Format = 26935297
- CurrentDate = 38323
- End
- Begin VB.Label Label1
- Caption = "事故编号:"
- Height = 315
- Left = 285
- TabIndex = 40
- Top = 270
- Width = 1305
- End
- Begin VB.Label Label2
- Caption = "车牌号码:"
- Height = 315
- Left = 285
- TabIndex = 39
- Top = 630
- Width = 1305
- End
- Begin VB.Label Label3
- Caption = "车辆类型:"
- Height = 315
- Left = 285
- TabIndex = 38
- Top = 990
- Width = 1305
- End
- Begin VB.Label Label4
- Caption = "事故时间:"
- Height = 315
- Left = 285
- TabIndex = 37
- Top = 1350
- Width = 1305
- End
- Begin VB.Label Label5
- Caption = "事故概要:"
- Height = 315
- Index = 0
- Left = 270
- TabIndex = 36
- Top = 1710
- Width = 1305
- End
- Begin VB.Label Label6
- Caption = "事故确认者:"
- Height = 315
- Left = 270
- TabIndex = 35
- Top = 2070
- Width = 1305
- End
- Begin VB.Label Label7
- Caption = "公司负担金:"
- Height = 315
- Left = 3015
- TabIndex = 34
- Top = 270
- Width = 1305
- End
- Begin VB.Label Label8
- Caption = "保险理赔金:"
- Height = 315
- Left = 3015
- TabIndex = 33
- Top = 630
- Width = 1305
- End
- Begin VB.Label Label9
- Caption = "对方赔偿金:"
- Height = 315
- Left = 3015
- TabIndex = 32
- Top = 990
- Width = 1305
- End
- Begin VB.Label Label10
- Caption = "对方姓名:"
- Height = 315
- Left = 3015
- TabIndex = 31
- Top = 1350
- Width = 1305
- End
- Begin VB.Label Label11
- Caption = "对方住址:"
- Height = 315
- Left = 3015
- TabIndex = 30
- Top = 1710
- Width = 1305
- End
- Begin VB.Label Label12
- Caption = "对方所在单位:"
- Height = 315
- Left = 3015
- TabIndex = 29
- Top = 2070
- Width = 1305
- End
- Begin VB.Label Label13
- Caption = "对方破坏程度:"
- Height = 315
- Left = 6150
- TabIndex = 28
- Top = 285
- Width = 1305
- End
- Begin VB.Label Label14
- Caption = "和解内容:"
- Height = 315
- Left = 6150
- TabIndex = 27
- Top = 1005
- Width = 1305
- End
- Begin VB.Label Label5
- Caption = "*"
- ForeColor = &H000000FF&
- Height = 210
- Index = 2
- Left = 1155
- TabIndex = 26
- Top = 255
- Width = 150
- End
- Begin VB.Label Label5
- Caption = "*"
- ForeColor = &H000000FF&
- Height = 135
- Index = 1
- Left = 1170
- TabIndex = 25
- Top = 630
- Width = 255
- End
- Begin VB.Label Label5
- Caption = "*"
- ForeColor = &H000000FF&
- Height = 135
- Index = 3
- Left = 1155
- TabIndex = 24
- Top = 1380
- Width = 255
- End
- Begin VB.Label Label5
- Caption = "*"
- ForeColor = &H000000FF&
- Height = 135
- Index = 4
- Left = 1155
- TabIndex = 23
- Top = 1740
- Width = 255
- End
- Begin VB.Label Label5
- Caption = "*"
- ForeColor = &H000000FF&
- Height = 135
- Index = 5
- Left = 1155
- TabIndex = 22
- Top = 2100
- Width = 255
- End
- Begin VB.Label Label5
- Caption = "*"
- ForeColor = &H000000FF&
- Height = 135
- Index = 6
- Left = 4140
- TabIndex = 21
- Top = 1410
- Width = 255
- End
- End
- Begin VB.CommandButton cmdExit
- Caption = " 退 出(&E)"
- Height = 330
- Left = 9015
- TabIndex = 0
- Top = 2610
- Width = 1095
- End
- Begin MSAdodcLib.Adodc Adodc1
- Height = 330
- Left = 3315
- Top = 2610
- Width = 3540
- _ExtentX = 6244
- _ExtentY = 582
- ConnectMode = 0
- CursorLocation = 3
- IsolationLevel = -1
- ConnectionTimeout= 15
- CommandTimeout = 30
- CursorType = 3
- LockType = 3
- CommandType = 1
- CursorOptions = 0
- CacheSize = 50
- MaxRecords = 0
- BOFAction = 0
- EOFAction = 0
- ConnectStringType= 1
- Appearance = 1
- BackColor = 12632256
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
- OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = "select * from 车辆事故表"
- Caption = " 浏览事故记录"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- _Version = 393216
- End
- Begin VB.CommandButton cmdDelete
- Caption = "删 除(&D)"
- Height = 330
- Left = 2235
- TabIndex = 1
- Top = 2610
- Width = 1095
- End
- Begin VB.CommandButton cmdUpdate
- Caption = "修 改(&U)"
- Height = 330
- Left = 1155
- TabIndex = 2
- Top = 2610
- Width = 1095
- End
- Begin VB.CommandButton cmdCancel
- Caption = "取 消(&Q)"
- Enabled = 0 'False
- Height = 330
- Left = 7935
- TabIndex = 3
- Top = 2610
- Width = 1095
- End
- Begin VB.CommandButton cmdok
- Caption = "确 定(&O)"
- Enabled = 0 'False
- Height = 330
- Left = 6855
- TabIndex = 5
- Top = 2610
- Width = 1095
- End
- Begin VB.CommandButton cmdAdd
- Caption = "添 加(&A)"
- Height = 330
- Left = 75
- TabIndex = 4
- Top = 2610
- Width = 1095
- End
- End
- Attribute VB_Name = "frmcarSGlr"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim i As Integer
- Private Sub cmdAdd_Click()
- Unlockctl
- Text1 = "": Text2 = "": Text3 = "": Text5 = ""
- Text6 = "": Text7 = "": Text8 = "": Text9 = ""
- Text10 = "": Text11 = "": Text12 = "": Text13 = ""
- Text14 = "": Text3 = "": Text1.SetFocus
- cmdOk.Enabled = True: cmdCancel.Enabled = True
- cmdUpdate.Enabled = False: cmdDelete.Enabled = False
- DTPicker1.Visible = True
- TextDTP.Visible = False: Adodc1.Enabled = False
- i = 1
- End Sub
- Private Sub cmdCancel_Click()
- On Error Resume Next '当没有添加数据的时候 处理异常
- Adodc1.Recordset.CancelUpdate
- Adodc1.Refresh
- Lockctl
- cmdOk.Enabled = False: cmdCancel.Enabled = False
- cmdAdd.Enabled = True: cmdUpdate.Enabled = True
- cmdDelete.Enabled = True: DTPicker1.Visible = False
- TextDTP.Visible = True: Adodc1.Enabled = True
- End Sub
- Private Sub cmdDelete_Click()
- If MsgBox("您确实要删除记录吗?", vbOKCancel, "系统提示") = vbOK Then
- adoCon.Execute ("delete from 车辆事故表 where 事故编号='" & Text1 & "'")
- MsgBox " 记录已删除!", , "系统提示"
- Adodc1.Refresh
- End If
- End Sub
- Private Sub cmdExit_Click()
- MDIForm1.StatusBar1.Panels(1).Text = ""
- Unload Me
- End Sub
- Private Sub cmdOk_Click()
- Select Case i
- Case 1:
- If Text1.Text = "" Then
- MsgBox "事故编号不能为空!", , "系统提示"
- Exit Sub
- End If
- If Text2.Text = "" Then
- MsgBox "车牌号码不能为空!", , "系统提示"
- Text2.SetFocus: Exit Sub
- End If
- If Text5.Text = "" Then
- MsgBox "事故概要不能为空!", , "系统提示"
- Text5.SetFocus: Exit Sub
- End If
- If Text6.Text = "" Then
- MsgBox "事故确认者不能为空!!", , "系统提示"
- Text6.SetFocus: Exit Sub
- End If
- If Text10 = "" Then
- MsgBox "对方姓名不能为空!!", , "系统提示"
- Text10.SetFocus: Exit Sub
- End If
- adoCon.Execute ("insert into 车辆事故表 values ('" & Text1 & "','" & Text2 & "','" & Text3.Text & "','" & DTPicker1.Value & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text10 & "','" & Text11 & "','" & Text12 & "','" & Text13 & "','" & Text14 & "')")
- MsgBox "记录添加成功!", , "系统提示"
- Adodc1.Refresh
- Case 2
- 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 & "'")
- MsgBox "记录修改成功!", , "系统提示"
- Adodc1.Refresh
- End Select
- Lockctl
- cmdOk.Enabled = False: cmdCancel.Enabled = False
- cmdAdd.Enabled = True: cmdUpdate.Enabled = True
- cmdDelete.Enabled = True: DTPicker1.Visible = False
- TextDTP.Visible = True: Adodc1.Enabled = True
- End Sub
- Private Sub cmdUpdate_Click()
- Unlockctl
- cmdOk.Enabled = True: cmdCancel.Enabled = True
- cmdAdd.Enabled = False: cmdDelete.Enabled = False
- DTPicker1.Visible = True: TextDTP.Visible = False
- Adodc1.Enabled = False: Text1.Enabled = False
- i = 2
- End Sub
- Private Sub text3_KeyPress(KeyAscii As Integer)
- KeyAscii = valiText(KeyAscii, Chr(13), True)
- If KeyAscii = 13 Then
- DTPicker1.SetFocus
- End If
- End Sub
- Private Sub Form_Load()
- frmcarSGlr.Width = 10350: frmcarSGlr.Height = 3435
- ' Adodc2.RecordSource = "select * from 车辆类型表"
- ' Adodc2.Refresh
- ' For i = 0 To Adodc2.Recordset.RecordCount - 1
- ' Text.AddItem Adodc2.Recordset.Fields(0).Value
- ' Adodc2.Recordset.MoveNext
- ' Next
- ' Combo1.Text = Adodc1.Recordset.Fields(2)
- End Sub
- Private Sub Lockctl()
- Text1.Enabled = False: Text2.Enabled = False
- Text3.Enabled = False: Text5.Enabled = False
- Text6.Enabled = False: Text7.Enabled = False
- Text8.Enabled = False: Text9.Enabled = False
- Text10.Enabled = False: Text11.Enabled = False
- Text12.Enabled = False: Text13.Enabled = False
- Text14.Enabled = False: DTPicker1.Enabled = False: TextDTP.Enabled = False
- End Sub
- Private Sub Unlockctl()
- Text1.Enabled = True: Text2.Enabled = True
- Text3.Enabled = True: Text5.Enabled = True
- Text6.Enabled = True: Text7.Enabled = True
- Text8.Enabled = True: Text9.Enabled = True
- Text10.Enabled = True: Text11.Enabled = True
- Text12.Enabled = True: Text13.Enabled = True
- Text14.Enabled = True: DTPicker1.Enabled = True: TextDTP.Enabled = True
- End Sub
- Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then
- If Text1.Text = "" Then
- MsgBox "不能为空,格式为日期“20040508”是有效格式!", , "系统提示"
- Exit Sub
- End If
- Text2.SetFocus
- End If
- End Sub
- Private Sub Text1_KeyPress(KeyAscii As Integer)
- KeyAscii = valiText(KeyAscii, Chr(8) & "0123456789" & Chr(13), True)
- End Sub
- Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then
- If Text2.Text = "" Then
- MsgBox "车牌号码不能为空!", , "系统提示"
- Text2.SetFocus
- Exit Sub
- End If
- Text3.SetFocus
- End If
- End Sub
- Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then Text5.SetFocus
- End Sub
- Private Sub Text2_LostFocus()
- If Text2.Text = "" Then Exit Sub
- Dim rss As New ADODB.Recordset
- Set rss = adoCon.Execute("select * from 车辆档案 where 车牌号码='" & Text2.Text & "'")
- If rss.EOF Then
- MsgBox "这辆车不属于本公司的!", , "系统提示"
- Text2.Text = ""
- Text2.SetFocus
- Exit Sub
- Else
- Text3.Text = rss.Fields(1).Value
- End If
- rss.Close
- Dim rss1 As New ADODB.Recordset
- Set rss1 = adoCon.Execute("select * from 车辆异动表 where 车牌号码='" & Text2.Text & "'")
- If rss1.EOF = False Then
- MsgBox "这辆车为异动车辆!", , "系统提示"
- Text2.Text = ""
- Text2.SetFocus
- Exit Sub
- End If
- rss1.Close
- End Sub
- Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then
- If Text5.Text = "" Then
- MsgBox "事故概要不能为空!", , "系统提示"
- Text5.SetFocus
- Exit Sub
- End If
- Text6.SetFocus
- End If
- End Sub
- Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then
- If Text6.Text = "" Then
- MsgBox "事故确认者不能为空!!", , "系统提示"
- Text6.SetFocus
- Exit Sub
- End If
- Text7.SetFocus
- End If
- End Sub
- Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then Text8.SetFocus
- End Sub
- Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then Text9.SetFocus
- End Sub
- Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then Text10.SetFocus
- End Sub
- Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then
- If Text10 = "" Then
- MsgBox "对方姓名不能为空!!", , "系统提示"
- Text10.SetFocus
- Exit Sub
- End If
- Text11.SetFocus
- End If
- End Sub
- Private Sub Text11_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then Text12.SetFocus
- End Sub
- Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then Text13.SetFocus
- End Sub
- Private Sub Text13_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then Text14.SetFocus
- End Sub
- Private Sub Text14_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = vbKeyReturn Then cmdOk.SetFocus
- End Sub