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

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. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  5. Begin VB.Form frmcarWXcha 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "车辆维修查询"
  8.    ClientHeight    =   3915
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   6255
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MDIChild        =   -1  'True
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3915
  17.    ScaleWidth      =   6255
  18.    ShowInTaskbar   =   0   'False
  19.    Begin VB.Frame Frame2 
  20.       Caption         =   "Frame2"
  21.       BeginProperty Font 
  22.          Name            =   "宋体"
  23.          Size            =   10.5
  24.          Charset         =   134
  25.          Weight          =   400
  26.          Underline       =   0   'False
  27.          Italic          =   0   'False
  28.          Strikethrough   =   0   'False
  29.       EndProperty
  30.       ForeColor       =   &H00FF0000&
  31.       Height          =   2145
  32.       Left            =   120
  33.       TabIndex        =   13
  34.       Top             =   1680
  35.       Width           =   5970
  36.       Begin MSAdodcLib.Adodc Adodc1 
  37.          Height          =   330
  38.          Left            =   3795
  39.          Top             =   660
  40.          Visible         =   0   'False
  41.          Width           =   1575
  42.          _ExtentX        =   2778
  43.          _ExtentY        =   582
  44.          ConnectMode     =   0
  45.          CursorLocation  =   3
  46.          IsolationLevel  =   -1
  47.          ConnectionTimeout=   15
  48.          CommandTimeout  =   30
  49.          CursorType      =   3
  50.          LockType        =   3
  51.          CommandType     =   1
  52.          CursorOptions   =   0
  53.          CacheSize       =   50
  54.          MaxRecords      =   0
  55.          BOFAction       =   0
  56.          EOFAction       =   0
  57.          ConnectStringType=   1
  58.          Appearance      =   1
  59.          BackColor       =   -2147483643
  60.          ForeColor       =   -2147483640
  61.          Orientation     =   0
  62.          Enabled         =   -1
  63.          Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  64.          OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  65.          OLEDBFile       =   ""
  66.          DataSourceName  =   ""
  67.          OtherAttributes =   ""
  68.          UserName        =   ""
  69.          Password        =   ""
  70.          RecordSource    =   "select * from 车辆维修表"
  71.          Caption         =   "Adodc1"
  72.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  73.             Name            =   "宋体"
  74.             Size            =   9
  75.             Charset         =   134
  76.             Weight          =   400
  77.             Underline       =   0   'False
  78.             Italic          =   0   'False
  79.             Strikethrough   =   0   'False
  80.          EndProperty
  81.          _Version        =   393216
  82.       End
  83.       Begin MSDataGridLib.DataGrid DataGrid1 
  84.          Bindings        =   "frmcarWXcha.frx":0000
  85.          Height          =   1755
  86.          Left            =   135
  87.          TabIndex        =   14
  88.          Top             =   270
  89.          Width           =   5715
  90.          _ExtentX        =   10081
  91.          _ExtentY        =   3096
  92.          _Version        =   393216
  93.          AllowUpdate     =   0   'False
  94.          HeadLines       =   1
  95.          RowHeight       =   15
  96.          FormatLocked    =   -1  'True
  97.          BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  98.             Name            =   "宋体"
  99.             Size            =   9
  100.             Charset         =   134
  101.             Weight          =   400
  102.             Underline       =   0   'False
  103.             Italic          =   0   'False
  104.             Strikethrough   =   0   'False
  105.          EndProperty
  106.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  107.             Name            =   "宋体"
  108.             Size            =   9
  109.             Charset         =   134
  110.             Weight          =   400
  111.             Underline       =   0   'False
  112.             Italic          =   0   'False
  113.             Strikethrough   =   0   'False
  114.          EndProperty
  115.          ColumnCount     =   10
  116.          BeginProperty Column00 
  117.             DataField       =   "车牌号码"
  118.             Caption         =   "车牌号码"
  119.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  120.                Type            =   0
  121.                Format          =   ""
  122.                HaveTrueFalseNull=   0
  123.                FirstDayOfWeek  =   0
  124.                FirstWeekOfYear =   0
  125.                LCID            =   2052
  126.                SubFormatType   =   0
  127.             EndProperty
  128.          EndProperty
  129.          BeginProperty Column01 
  130.             DataField       =   "更换零件1"
  131.             Caption         =   "更换零件1"
  132.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  133.                Type            =   0
  134.                Format          =   ""
  135.                HaveTrueFalseNull=   0
  136.                FirstDayOfWeek  =   0
  137.                FirstWeekOfYear =   0
  138.                LCID            =   2052
  139.                SubFormatType   =   0
  140.             EndProperty
  141.          EndProperty
  142.          BeginProperty Column02 
  143.             DataField       =   "零件1数量"
  144.             Caption         =   "零件1数量"
  145.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  146.                Type            =   0
  147.                Format          =   ""
  148.                HaveTrueFalseNull=   0
  149.                FirstDayOfWeek  =   0
  150.                FirstWeekOfYear =   0
  151.                LCID            =   2052
  152.                SubFormatType   =   0
  153.             EndProperty
  154.          EndProperty
  155.          BeginProperty Column03 
  156.             DataField       =   "更换零件2"
  157.             Caption         =   "更换零件2"
  158.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  159.                Type            =   0
  160.                Format          =   ""
  161.                HaveTrueFalseNull=   0
  162.                FirstDayOfWeek  =   0
  163.                FirstWeekOfYear =   0
  164.                LCID            =   2052
  165.                SubFormatType   =   0
  166.             EndProperty
  167.          EndProperty
  168.          BeginProperty Column04 
  169.             DataField       =   "零件2数量"
  170.             Caption         =   "零件2数量"
  171.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  172.                Type            =   0
  173.                Format          =   ""
  174.                HaveTrueFalseNull=   0
  175.                FirstDayOfWeek  =   0
  176.                FirstWeekOfYear =   0
  177.                LCID            =   2052
  178.                SubFormatType   =   0
  179.             EndProperty
  180.          EndProperty
  181.          BeginProperty Column05 
  182.             DataField       =   "更换零件3"
  183.             Caption         =   "更换零件3"
  184.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  185.                Type            =   0
  186.                Format          =   ""
  187.                HaveTrueFalseNull=   0
  188.                FirstDayOfWeek  =   0
  189.                FirstWeekOfYear =   0
  190.                LCID            =   2052
  191.                SubFormatType   =   0
  192.             EndProperty
  193.          EndProperty
  194.          BeginProperty Column06 
  195.             DataField       =   "零件3数量"
  196.             Caption         =   "零件3数量"
  197.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  198.                Type            =   0
  199.                Format          =   ""
  200.                HaveTrueFalseNull=   0
  201.                FirstDayOfWeek  =   0
  202.                FirstWeekOfYear =   0
  203.                LCID            =   2052
  204.                SubFormatType   =   0
  205.             EndProperty
  206.          EndProperty
  207.          BeginProperty Column07 
  208.             DataField       =   "维修日期"
  209.             Caption         =   "维修日期"
  210.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  211.                Type            =   0
  212.                Format          =   ""
  213.                HaveTrueFalseNull=   0
  214.                FirstDayOfWeek  =   0
  215.                FirstWeekOfYear =   0
  216.                LCID            =   2052
  217.                SubFormatType   =   0
  218.             EndProperty
  219.          EndProperty
  220.          BeginProperty Column08 
  221.             DataField       =   "共计费用"
  222.             Caption         =   "共计费用"
  223.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  224.                Type            =   0
  225.                Format          =   ""
  226.                HaveTrueFalseNull=   0
  227.                FirstDayOfWeek  =   0
  228.                FirstWeekOfYear =   0
  229.                LCID            =   2052
  230.                SubFormatType   =   0
  231.             EndProperty
  232.          EndProperty
  233.          BeginProperty Column09 
  234.             DataField       =   "备注"
  235.             Caption         =   "备注"
  236.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  237.                Type            =   0
  238.                Format          =   ""
  239.                HaveTrueFalseNull=   0
  240.                FirstDayOfWeek  =   0
  241.                FirstWeekOfYear =   0
  242.                LCID            =   2052
  243.                SubFormatType   =   0
  244.             EndProperty
  245.          EndProperty
  246.          SplitCount      =   1
  247.          BeginProperty Split0 
  248.             BeginProperty Column00 
  249.                ColumnWidth     =   840.189
  250.             EndProperty
  251.             BeginProperty Column01 
  252.                ColumnWidth     =   915.024
  253.             EndProperty
  254.             BeginProperty Column02 
  255.                ColumnWidth     =   929.764
  256.             EndProperty
  257.             BeginProperty Column03 
  258.                ColumnWidth     =   915.024
  259.             EndProperty
  260.             BeginProperty Column04 
  261.                ColumnWidth     =   900.284
  262.             EndProperty
  263.             BeginProperty Column05 
  264.                ColumnWidth     =   959.811
  265.             EndProperty
  266.             BeginProperty Column06 
  267.                ColumnWidth     =   900.284
  268.             EndProperty
  269.             BeginProperty Column07 
  270.                ColumnWidth     =   854.929
  271.             EndProperty
  272.             BeginProperty Column08 
  273.                ColumnWidth     =   780.095
  274.             EndProperty
  275.             BeginProperty Column09 
  276.                ColumnWidth     =   494.929
  277.             EndProperty
  278.          EndProperty
  279.       End
  280.    End
  281.    Begin VB.Frame Frame1 
  282.       Caption         =   "  查询条件"
  283.       ForeColor       =   &H00FF0000&
  284.       Height          =   1455
  285.       Left            =   120
  286.       TabIndex        =   0
  287.       Top             =   120
  288.       Width           =   5970
  289.       Begin VB.CommandButton cmdCha 
  290.          Caption         =   "查 询(&F)"
  291.          Height          =   330
  292.          Left            =   4845
  293.          TabIndex        =   12
  294.          Top             =   255
  295.          Width           =   975
  296.       End
  297.       Begin VB.CommandButton cmdExit 
  298.          Caption         =   "退 出(&E)"
  299.          Height          =   345
  300.          Left            =   4875
  301.          TabIndex        =   11
  302.          Top             =   975
  303.          Width           =   975
  304.       End
  305.       Begin VB.ComboBox Combo1 
  306.          Height          =   300
  307.          ItemData        =   "frmcarWXcha.frx":0015
  308.          Left            =   1575
  309.          List            =   "frmcarWXcha.frx":0028
  310.          TabIndex        =   10
  311.          Top             =   1035
  312.          Width           =   735
  313.       End
  314.       Begin VB.TextBox txtFY 
  315.          Enabled         =   0   'False
  316.          Height          =   300
  317.          Left            =   2325
  318.          TabIndex        =   9
  319.          Top             =   1020
  320.          Width           =   2355
  321.       End
  322.       Begin VB.CheckBox ckfy 
  323.          Caption         =   "维修费用:"
  324.          Height          =   255
  325.          Left            =   120
  326.          TabIndex        =   8
  327.          Top             =   1035
  328.          Width           =   1215
  329.       End
  330.       Begin VB.ComboBox cmcp 
  331.          Enabled         =   0   'False
  332.          Height          =   300
  333.          Left            =   1575
  334.          TabIndex        =   3
  335.          Top             =   270
  336.          Width           =   1320
  337.       End
  338.       Begin VB.CheckBox cktime 
  339.          Caption         =   "维修日期:"
  340.          Height          =   180
  341.          Left            =   120
  342.          TabIndex        =   2
  343.          Top             =   705
  344.          Width           =   1215
  345.       End
  346.       Begin VB.CheckBox ckcp 
  347.          Caption         =   "车牌号码:"
  348.          Height          =   255
  349.          Left            =   120
  350.          TabIndex        =   1
  351.          Top             =   270
  352.          Width           =   1215
  353.       End
  354.       Begin MSComCtl2.DTPicker dtEnd 
  355.          Height          =   300
  356.          Left            =   3360
  357.          TabIndex        =   4
  358.          Top             =   645
  359.          Width           =   1335
  360.          _ExtentX        =   2355
  361.          _ExtentY        =   529
  362.          _Version        =   393216
  363.          Enabled         =   0   'False
  364.          Format          =   27000833
  365.          CurrentDate     =   38053
  366.       End
  367.       Begin MSComCtl2.DTPicker dtStart 
  368.          Height          =   300
  369.          Left            =   1575
  370.          TabIndex        =   5
  371.          Top             =   645
  372.          Width           =   1335
  373.          _ExtentX        =   2355
  374.          _ExtentY        =   529
  375.          _Version        =   393216
  376.          Enabled         =   0   'False
  377.          Format          =   27000833
  378.          CurrentDate     =   38053
  379.       End
  380.       Begin VB.Label Label5 
  381.          Caption         =   "到"
  382.          ForeColor       =   &H00FF0000&
  383.          Height          =   255
  384.          Left            =   3045
  385.          TabIndex        =   7
  386.          Top             =   705
  387.          Width           =   255
  388.       End
  389.       Begin VB.Label Label6 
  390.          Caption         =   "从"
  391.          ForeColor       =   &H00FF0000&
  392.          Height          =   255
  393.          Left            =   1335
  394.          TabIndex        =   6
  395.          Top             =   720
  396.          Width           =   255
  397.       End
  398.    End
  399. End
  400. Attribute VB_Name = "frmcarWXcha"
  401. Attribute VB_GlobalNameSpace = False
  402. Attribute VB_Creatable = False
  403. Attribute VB_PredeclaredId = True
  404. Attribute VB_Exposed = False
  405. Private Sub ckcp_Click()
  406.     If ckcp.Value Then
  407.         cmCP.Enabled = True
  408.     Else
  409.         cmCP.Enabled = False
  410.     End If
  411. End Sub
  412. Private Sub ckfy_Click()
  413.     If ckfy.Value Then
  414.         Combo1.Enabled = True
  415.         Combo1.ListIndex = 0
  416.         txtFY.Enabled = True
  417.     Else
  418.         txtFY.Enabled = False
  419.         Combo1.Enabled = False
  420.     End If
  421. End Sub
  422. Private Sub cktime_Click()
  423.     If cktime.Value Then
  424.         dtStart.Enabled = True
  425.         dtEnd.Enabled = True
  426.     Else
  427.         dtStart.Enabled = False
  428.         dtEnd.Enabled = False
  429.     End If
  430. End Sub
  431. Private Sub cmdCha_Click()
  432.     Call QingKong
  433.     
  434.     
  435.    
  436.     Dim sql As String
  437.        
  438.     Dim scp As String
  439.     If ckcp.Value Then
  440.         scp = "车牌号码 like '" & cmCP.Text & "%'"
  441.     Else
  442.         scp = "车牌号码 like '%'"
  443.     End If
  444.     
  445.     Dim stime As String
  446.     If cktime.Value Then
  447.         stime = "维修日期 between #" & dtStart.Month & "/" & dtStart.Day & "/" & dtStart.Year & "# and #" & dtEnd.Month & "/" & dtEnd.Day & "/" & dtEnd.Year & "#"
  448.         Else
  449.         stime = "维修日期 like '%'"
  450.     End If
  451.     
  452.      
  453.     Dim sfy As String
  454.     If ckfy.Value Then
  455.         
  456.         sfy = "共计费用 " & Combo1.Text & "" & txtFY & ""
  457.     Else
  458.         sfy = "共计费用 like '%'"
  459.     End If
  460.     
  461.     sql = "select * from 车辆维修表 where " & scp & "and " & stime & "and " & sfy
  462.     'MsgBox sql
  463.     
  464.     
  465.     If sql = "select * from 车辆维修表 where 车牌号码 like '%'and 维修日期 like '%'and 共计费用 like '%'" Then
  466.         Call QingKong
  467.         MsgBox "请选择查询条件", , "系统提示"
  468.         Exit Sub
  469.     End If
  470.     
  471.     Set adors = adoCon.Execute(sql)
  472.     
  473.     If adors.EOF Then
  474.         Call QingKong
  475.         MsgBox "对不起,没有符合您查询条件的车辆维修记录!", , "系统提示"
  476.     Else
  477.        Adodc1.RecordSource = sql
  478.        Adodc1.Refresh
  479.     End If
  480.     
  481.     adors.Close
  482.     
  483.     ckcp.Value = 0
  484.     cktime.Value = 0
  485.     ckfy.Value = 0
  486. End Sub
  487. Private Sub cmdExit_Click()
  488.     MDIForm1.StatusBar1.Panels(1).Text = ""
  489.     Unload Me
  490. End Sub
  491. Private Sub Form_Load()
  492.     frmcarWXcha.Width = 6345
  493.     frmcarWXcha.Height = 4395
  494.     Call Rebind
  495.    'add all cp in the table carWX
  496.     Set adors = adoCon.Execute("select distinct 车牌号码 from 车辆维修表")
  497.     On Error Resume Next
  498.     Do
  499.         cmCP.AddItem adors.Fields(0)
  500.         adors.MoveNext
  501.     Loop Until adors.EOF
  502.     adors.Close
  503. End Sub
  504. Private Sub Rebind()
  505.     Frame2.Caption = "车辆维修列表"
  506.     Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "clgl.mdb;Persist Security Info=False"
  507.     Adodc1.RecordSource = "select * from 车辆维修表"
  508.     Adodc1.Refresh
  509. End Sub
  510. Private Sub QingKong()
  511.     Frame2.Caption = "您所要查询的车辆维修记录如下:"
  512.     Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "clgl.mdb;Persist Security Info=False"
  513.     Adodc1.RecordSource = "select * from 车辆维修表 where 1=0"
  514.     Adodc1.Refresh
  515. End Sub
  516. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  517.     cmdExit_Click
  518. End Sub