📄 sell_month.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"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form Sell_month
Caption = "销售月报表"
ClientHeight = 6555
ClientLeft = 60
ClientTop = 465
ClientWidth = 9720
Icon = "Sell_month.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 6555
ScaleWidth = 9720
Begin MSAdodcLib.Adodc Adodc2
Height = 375
Left = 4920
Top = 3120
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
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 = 375
Left = 960
Top = 3000
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 661
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.Frame Frame2
Caption = "请选择查询日期区间:"
Height = 855
Left = 120
TabIndex = 12
Top = 120
Width = 5655
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 3120
TabIndex = 15
Top = 360
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
Format = 25493505
CurrentDate = 39045
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 480
TabIndex = 13
Top = 360
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
Format = 25493505
CurrentDate = 39045
End
Begin VB.Label Label1
Caption = "至"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2400
TabIndex = 14
Top = 480
Width = 375
End
End
Begin VB.Frame Frame1
Caption = "汇总结果:"
Height = 975
Left = 120
TabIndex = 3
Top = 5520
Width = 9495
Begin VB.Label Label13
Caption = "元"
Height = 255
Left = 8760
TabIndex = 19
Top = 360
Width = 255
End
Begin VB.Label Label12
Caption = "元"
Height = 255
Left = 6240
TabIndex = 18
Top = 360
Width = 255
End
Begin VB.Label Label11
Caption = "辆"
Height = 255
Left = 3960
TabIndex = 17
Top = 360
Width = 255
End
Begin VB.Label Label10
Caption = "款"
Height = 255
Left = 1920
TabIndex = 16
Top = 360
Width = 255
End
Begin VB.Label Lablr
Height = 255
Left = 7680
TabIndex = 11
Top = 360
Width = 975
End
Begin VB.Label Labje
Height = 255
Left = 5280
TabIndex = 10
Top = 360
Width = 975
End
Begin VB.Label Labsl
Height = 255
Left = 3240
TabIndex = 9
Top = 360
Width = 735
End
Begin VB.Label Labcx
Height = 255
Left = 1200
TabIndex = 8
Top = 360
Width = 615
End
Begin VB.Label Label5
Caption = "所获利润:"
Height = 255
Left = 6720
TabIndex = 7
Top = 360
Width = 975
End
Begin VB.Label Label4
Caption = "销售金额:"
Height = 255
Left = 4320
TabIndex = 6
Top = 360
Width = 975
End
Begin VB.Label Label3
Caption = "销售数量:"
Height = 255
Left = 2280
TabIndex = 5
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "销售车型:"
Height = 255
Left = 240
TabIndex = 4
Top = 360
Width = 975
End
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 = 8280
TabIndex = 2
Top = 360
Width = 975
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 = 6840
TabIndex = 1
Top = 360
Width = 975
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 4095
Left = 120
TabIndex = 0
Top = 1200
Width = 9495
_ExtentX = 16748
_ExtentY = 7223
_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.Line Line2
X1 = 120
X2 = 9600
Y1 = 5400
Y2 = 5400
End
Begin VB.Line Line1
X1 = 120
X2 = 9600
Y1 = 1080
Y2 = 1080
End
End
Attribute VB_Name = "Sell_month"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Adodc1.RecordSource = "select 车型编号,车型,金额,数量,经手人,总金额,利润 from 销售信息表 where 销售日期 between '" & DTPicker1.Value & "' and '" & DTPicker2.Value & "'"
Adodc1.Refresh
Adodc2.RecordSource = "select count(车型)as 车型,sum(数量)as 数量,sum(总金额)as 金额,sum(利润)as 利润 from 销售信息表 where 销售日期 between '" & DTPicker1.Value & "' and '" & DTPicker2.Value & "'"
Adodc2.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "您所查询日期销量为空!", 0, "提示信息"
End If
Set DataGrid1.DataSource = Adodc1
With Adodc2.Recordset
If .Fields(0) <> "" Then Labcx.Caption = .Fields(0) Else Labcx.Caption = 0
If .Fields(1) <> "" Then Labsl.Caption = .Fields(1) Else Labsl.Caption = 0
If .Fields(2) <> "" Then Labje.Caption = .Fields(2) Else Labje.Caption = 0
If .Fields(3) <> "" Then Lablr.Caption = .Fields(3) Else Lablr.Caption = 0
End With
End Sub
Private Sub Command2_Click()
Unload Sell_month
End Sub
Private Sub DTPicker1_Change()
DTPicker2.MinDate = DTPicker1.Value
End Sub
Private Sub Form_Load()
DTPicker1.MaxDate = Date
DTPicker2.MaxDate = Date
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -