- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
frmAcc2.frm
资源名称:车辆管理信息系统2.rar [点击查看]
上传用户:lizhip88
上传日期:2007-06-21
资源大小:42k
文件大小:9k
源码类别:
交通/航空行业
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmAcc2
- BorderStyle = 3 'Fixed Dialog
- Caption = "车辆事故查询"
- ClientHeight = 2256
- ClientLeft = 48
- ClientTop = 336
- ClientWidth = 4704
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2256
- ScaleWidth = 4704
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 'CenterOwner
- Begin VB.Frame Frame1
- Height = 1095
- Left = 1560
- TabIndex = 11
- Top = 600
- Width = 2895
- Begin VB.ComboBox cboMonth
- Height = 300
- Index = 0
- Left = 1845
- Style = 2 'Dropdown List
- TabIndex = 2
- Top = 240
- Width = 645
- End
- Begin VB.ComboBox cboMonth
- Height = 300
- Index = 1
- Left = 1845
- Style = 2 'Dropdown List
- TabIndex = 4
- Top = 690
- Width = 645
- End
- Begin VB.ComboBox cboYear
- Height = 300
- Index = 0
- Left = 675
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 240
- Width = 765
- End
- Begin VB.ComboBox cboYear
- Height = 300
- Index = 1
- Left = 675
- Style = 2 'Dropdown List
- TabIndex = 3
- Top = 690
- Width = 765
- End
- Begin VB.Label Label1
- Caption = "月"
- Height = 210
- Index = 7
- Left = 2520
- TabIndex = 17
- Top = 720
- Width = 240
- End
- Begin VB.Label Label1
- Caption = "从:"
- Height = 210
- Index = 6
- Left = 240
- TabIndex = 16
- Top = 240
- Width = 375
- End
- Begin VB.Label Label1
- Caption = "年"
- Height = 210
- Index = 1
- Left = 1515
- TabIndex = 15
- Top = 240
- Width = 240
- End
- Begin VB.Label Label1
- Caption = "月"
- Height = 210
- Index = 2
- Left = 2520
- TabIndex = 14
- Top = 240
- Width = 240
- End
- Begin VB.Label Label1
- Caption = "到:"
- Height = 210
- Index = 3
- Left = 255
- TabIndex = 13
- Top = 735
- Width = 375
- End
- Begin VB.Label Label1
- Caption = "年"
- Height = 210
- Index = 4
- Left = 1545
- TabIndex = 12
- Top = 735
- Width = 225
- End
- End
- Begin VB.CheckBox chkItem
- Caption = "Check1"
- Height = 180
- Index = 1
- Left = 240
- TabIndex = 10
- Top = 720
- Width = 255
- End
- Begin VB.CheckBox chkItem
- Caption = "Check1"
- Height = 180
- Index = 0
- Left = 240
- TabIndex = 9
- Top = 240
- Value = 1 'Checked
- Width = 255
- End
- Begin VB.CommandButton cmdOk
- Caption = "确定 (&O)"
- Default = -1 'True
- Height = 375
- Left = 960
- TabIndex = 5
- Top = 1800
- Width = 1215
- End
- Begin VB.CommandButton cmdExit
- Caption = "取消 (&X)"
- Height = 375
- Left = 2520
- TabIndex = 6
- Top = 1800
- Width = 1215
- End
- Begin VB.TextBox txtItem
- Height = 270
- Index = 0
- Left = 1560
- TabIndex = 0
- Top = 240
- Width = 2895
- End
- Begin VB.Label lblitem
- Caption = "时 间:"
- Height = 255
- Index = 1
- Left = 600
- TabIndex = 8
- Top = 720
- Width = 1095
- End
- Begin VB.Label lblitem
- Caption = "车 牌 号:"
- Height = 255
- Index = 0
- Left = 600
- TabIndex = 7
- Top = 240
- Width = 1095
- End
- End
- Attribute VB_Name = "frmAcc2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cboMonth_Click(Index As Integer)
- If cboMonth(0) <> "" And cboMonth(1) <> "" Then
- If CInt(cboYear(0)) = CInt(cboYear(1)) Then
- Select Case Index
- Case 0
- If CInt(cboMonth(Index)) > CInt(cboMonth(1)) Then
- cboMonth(Index) = cboMonth(1)
- End If
- Case 1
- If CInt(cboMonth(Index)) < CInt(cboMonth(0)) Then
- cboMonth(Index) = cboMonth(0)
- End If
- End Select
- End If
- End If
- End Sub
- Private Sub cboYear_Click(Index As Integer)
- If cboYear(0) <> "" And cboYear(1) <> "" Then
- Select Case Index
- Case 0
- If CInt(cboYear(Index)) > CInt(cboYear(1)) Then
- cboYear(Index) = cboYear(1)
- End If
- Case 1
- If CInt(cboYear(Index)) < CInt(cboYear(1)) Then
- cboYear(Index) = cboYear(0)
- End If
- End Select
- Call cboMonth_Click(Index)
- End If
- End Sub
- Private Sub chkItem_Click(Index As Integer)
- If Index = 1 Then
- cboYear(0).SetFocus
- Else
- txtItem(Index).SetFocus
- End If
- End Sub
- Private Sub cmdExit_Click()
- Me.Hide
- End Sub
- Private Sub cmdOK_Click()
- Dim dBeginDate As String
- Dim dEndDateTemp As Date
- Dim dEndDate As String
- Dim txtSQL As String
- If chkItem(0).Value = vbChecked Then
- txtSQL = " sgid ='" & Trim(txtItem(0) & " ") & "'"
- End If
- If chkItem(1).Value = vbChecked Then
- dBeginDate = Format(CDate(cboYear(0) & "-" & cboMonth(0) & "-1"), "yyyy-mm-dd")
- dEndDateTemp = DateAdd("d", -1, DateAdd("m", 1, DateSerial(CInt(cboYear(1)), CInt(cboMonth(1)), 1)))
- dEndDate = Format(dEndDateTemp, "yyyy-mm-dd")
- If Trim(txtSQL & " ") = "" Then
- txtSQL = " sgdate>='" & dBeginDate & "' and sgdate<='" & dEndDate & "'"
- Else
- txtSQL = txtSQL & " and (sgdate>='" & dBeginDate & "' and sgdate<='" & dEndDate & "')"
- End If
- End If
- If Trim(txtSQL) = "" Then
- MsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"
- Exit Sub
- Else
- If flagaEdit Then
- Unload frmAcc
- End If
- frmAcc.txtSQL = "select sgid,sgdate,sgplace,sgreason,sgdriver,sgopp_dept,sgopp_id,sgmode,sgvalue,sgmemo from accident where" & txtSQL
- frmAcc.Show
- End If
- Me.Hide
- End Sub
- Private Sub Form_Load()
- Dim i As Integer
- Dim j As Integer
- Dim txtSQL As String
- Dim mrc As ADODB.Recordset
- Dim MsgText As String
- txtSQL = "select distinct datepart(yy,sgdate) from accident"
- Set mrc = ExecuteSQL(txtSQL, MsgText)
- If mrc.EOF = False Then
- With mrc
- Do While Not .EOF
- cboYear(0).AddItem .Fields(0)
- cboYear(1).AddItem .Fields(0)
- .MoveNext
- Loop
- End With
- For i = 0 To 1
- cboYear(i).ListIndex = 0
- Next i
- For i = 0 To 1
- For j = 1 To 12
- cboMonth(i).AddItem j
- Next j
- Next i
- For i = 0 To 1
- cboMonth(i).Text = Month(Now())
- Next i
- Else
- cmdOk.Enabled = False
- End If
- mrc.Close
- End Sub
- Private Sub lblitem_Click(Index As Integer)
- chkItem(Index).Value = vbChecked
- End Sub
- Private Sub txtItem_GotFocus(Index As Integer)
- txtItem(Index).SelStart = 0
- txtItem(Index).SelLength = Len(txtItem(Index))
- End Sub