⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 warehouse_find.frm

📁 一个简单的汽车销售管理数据库系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Warehouse_find 
   Caption         =   "库存查询"
   ClientHeight    =   6375
   ClientLeft      =   60
   ClientTop       =   465
   ClientWidth     =   9720
   Icon            =   "Warehouse_find.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   6375
   ScaleWidth      =   9720
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   615
      Left            =   4440
      Top             =   3000
      Visible         =   0   'False
      Width           =   2055
      _ExtentX        =   3625
      _ExtentY        =   1085
      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=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=CARS"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "CARS"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      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 MSAdodcLib.Adodc Adodc1 
      Height          =   615
      Left            =   1320
      Top             =   3000
      Visible         =   0   'False
      Width           =   2055
      _ExtentX        =   3625
      _ExtentY        =   1085
      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=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=CARS"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "CARS"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      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 Command1 
      Caption         =   "查询"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   8040
      TabIndex        =   15
      Top             =   240
      Width           =   975
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   3375
      Left            =   120
      TabIndex        =   14
      Top             =   1680
      Width           =   9495
      _ExtentX        =   16748
      _ExtentY        =   5953
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   8040
      TabIndex        =   4
      Top             =   840
      Width           =   975
   End
   Begin VB.Frame Frame2 
      Caption         =   "汇总结果"
      Height          =   855
      Left            =   120
      TabIndex        =   1
      Top             =   5280
      Width           =   9495
      Begin VB.Label Label10 
         Caption         =   "库存金额:"
         Height          =   255
         Left            =   6120
         TabIndex        =   19
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label7 
         Caption         =   "款"
         Height          =   255
         Left            =   4800
         TabIndex        =   18
         Top             =   360
         Width           =   255
      End
      Begin VB.Label Labcx 
         Height          =   255
         Left            =   3960
         TabIndex        =   17
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label5 
         Caption         =   "库存车型:"
         Height          =   255
         Left            =   3000
         TabIndex        =   16
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "元"
         Height          =   255
         Left            =   8400
         TabIndex        =   13
         Top             =   360
         Width           =   375
      End
      Begin VB.Label Label2 
         Caption         =   "辆"
         Height          =   255
         Left            =   1800
         TabIndex        =   12
         Top             =   360
         Width           =   255
      End
      Begin VB.Label Labje 
         Height          =   255
         Left            =   7200
         TabIndex        =   11
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label labsl 
         Height          =   255
         Left            =   1080
         TabIndex        =   10
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "库存数量:"
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   360
         Width           =   975
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "查询"
      Height          =   1335
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   7215
      Begin VB.ComboBox Combo3 
         Height          =   300
         Left            =   1920
         TabIndex        =   20
         Top             =   720
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   3720
         TabIndex        =   8
         Top             =   720
         Width           =   2655
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   1920
         TabIndex        =   7
         Top             =   720
         Width           =   1215
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   120
         TabIndex        =   3
         Top             =   720
         Width           =   1455
      End
      Begin VB.Label Label9 
         Caption         =   "查询内容"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3720
         TabIndex        =   6
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label8 
         Caption         =   "查询项目"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   5
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label4 
         Caption         =   "查询条件"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1920
         TabIndex        =   2
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.Line Line3 
      X1              =   120
      X2              =   9600
      Y1              =   5160
      Y2              =   5160
   End
   Begin VB.Line Line2 
      X1              =   120
      X2              =   9600
      Y1              =   1560
      Y2              =   1560
   End
   Begin VB.Line Line1 
      X1              =   0
      X2              =   9720
      Y1              =   6240
      Y2              =   6240
   End
End
Attribute VB_Name = "Warehouse_find"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
If Combo1.Text = "车型编号" Then
Combo2.Visible = True
Combo3.Visible = False
Else
If Combo1.Text = "车型" Then
Combo2.Visible = False
Combo3.Visible = True
End If
End If
End Sub

Private Sub Command1_Click()
If Combo1.Text = "车型" Then
 Adodc1.RecordSource = "select * from 库存信息表 where 库存信息表." & Combo1.Text & " like '%'+'" & Text1.Text & "'+'%'"
 Adodc1.Refresh
 Adodc2.RecordSource = "select sum(库存数量)as 数量,count(车型)as 车型,sum(合计金额)as 金额 from 库存信息表 where 库存信息表." & Combo1.Text & " like '%'+'" & Text1.Text & "'+'%'"
 Adodc2.Refresh
Else
If Combo1.Text = "车型编号" Then
 Adodc1.RecordSource = "select * from 库存信息表 where 库存信息表." & Combo1 & Combo2 & "'" + Text1.Text + "'"
 Adodc1.Refresh
 Adodc2.RecordSource = "select sum(库存数量)as 数量,count(车型)as 车型,sum(合计金额)as 金额 from 库存信息表 where 库存信息表." & Combo1 & Combo2 & "'" + Text1.Text + "'"
 Adodc2.Refresh
End If
End If
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "您所查询结果为空!", 0, "提示信息"
End If
Set DataGrid1.DataSource = Adodc1
With Adodc2.Recordset
If .Fields(0) <> "" Then Labsl.Caption = .Fields(0) Else Labsl.Caption = 0
If .Fields(1) <> "" Then Labcx.Caption = .Fields(1) Else Labcx.Caption = 0
If .Fields(2) <> "" Then Labje.Caption = .Fields(2) Else Labje.Caption = 0
End With
End Sub

Private Sub Command2_Click()
Unload Warehouse_find
End Sub

Private Sub Form_Load()
Combo1.AddItem ("车型编号")
Combo1.AddItem ("车型")
Combo1.ListIndex = 1
Combo2.AddItem (">")
Combo2.AddItem ("<")
Combo2.AddItem ("=")
Combo2.AddItem (">=")
Combo2.AddItem ("<=")
Combo2.AddItem ("<>")
Combo2.ListIndex = 2
Combo3.AddItem ("like")
Combo3.ListIndex = 0
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -