📄 todaysum.frm
字号:
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 7
Text = "Text3"
Top = 1560
Width = 2052
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 5
Top = 2400
Width = 2052
End
Begin VB.TextBox Text1
DataField = "出售总数量"
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 1
EndProperty
DataSource = "Adodc2"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 3
Text = "Text1"
Top = 720
Width = 2052
End
Begin VB.Label Label4
Caption = "按光碟名数据查找"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 240
TabIndex = 6
Top = 2040
Width = 2172
End
Begin VB.Label Label3
Caption = "当日总销售额"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 240
TabIndex = 4
Top = 1200
Width = 2052
End
Begin VB.Label Label2
Caption = "当日总销售量"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 240
TabIndex = 2
Top = 360
Width = 1572
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 9840
Top = 7800
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 688
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 = $"todaysum.frx":2F8D
OLEDBString = $"todaysum.frx":301E
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select 盘号,光碟名,sum(出售数量) as 销售总量,sum(销售总价) as 总金额 from 销售情况表 group by 盘号,光碟名"
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.Label Label1
Caption = "当日销售情况统计信息"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 0
Top = 480
Width = 2535
End
End
Attribute VB_Name = "todaysum"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
todaysum.Hide
Set todaysum = Nothing
formpayout.Show
End Sub
Private Sub Command2_Click()
Dim filename As String
Dim tbl As TableDef
Dim fld As Field
Dim idx As Index
Dim db As Database
CommonDialog1.Action = 2
CommonDialog1.InitDir = "d:\毕业设计\设计\数据库备份"
CommonDialog1.Filter = "*.mdb"
'Set myws = DBEngine.CreateWorkspace("sample", "admin", "")
'DBEngine.Workspaces.Append myws
filename = CStr(CommonDialog1.filename)
Set db = DBEngine.Workspaces(0).CreateDatabase(filename, dbLangGeneral)
Set tbl = db.CreateTableDef("销售情况表")
'db.TableDefs.Append tbl
Set fld = tbl.CreateField("盘号", dbLong)
tbl.Fields.Append fld
Set fld = tbl.CreateField("光碟名", dbText)
tbl.Fields.Append fld
Set fld = tbl.CreateField("价格", dbCurrency)
tbl.Fields.Append fld
Set fld = tbl.CreateField("销售总价", dbCurrency)
tbl.Fields.Append fld
Set fld = tbl.CreateField("出售数量", dbLong)
tbl.Fields.Append fld
Set fld = tbl.CreateField("售出时间", dbText)
tbl.Fields.Append fld
Set idx = tbl.CreateIndex("盘号")
idx.IgnoreNulls = True
tbl.Indexes.Append idx
Set idx = tbl.CreateIndex("光碟名")
idx.IgnoreNulls = True
tbl.Indexes.Append idx
Set idx = tbl.CreateIndex("售出时间")
idx.IgnoreNulls = True
tbl.Indexes.Append idx
Set tbl1 = db.CreateTableDef("影碟销售表")
db.TableDefs.Append tbl
db.Close
End Sub
Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "当日销售歌碟数据备份"
End Sub
Private Sub Command3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "当日销售歌碟数据还原"
End Sub
Private Sub Command4_Click()
DataReport1.Show
DataReport1.Refresh
Unload Me
End Sub
Private Sub Command4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "当日歌碟销售报表打印"
End Sub
Private Sub DataGrid1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "当日销售情况统计数据"
End Sub
Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select 盘号,光碟名,sum(出售数量) as 销售总量,sum(销售总价) as 总金额 from 销售情况表 where 售出时间 = # " & DTPicker1.Value & "# group by 盘号,光碟名"
Adodc1.Refresh
End Sub
Private Sub DTPicker1_Change()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select 盘号,光碟名,sum(出售数量) as 销售总量,sum(销售总价) as 总金额 from 销售情况表 where 售出时间 = # " & DTPicker1.Value & "# group by 盘号,光碟名"
Adodc1.Refresh
End Sub
Private Sub DTPicker1_Click()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select 盘号,光碟名,sum(出售数量) as 销售总量,sum(销售总价) as 总金额 from 销售情况表 where 售出时间 = # " & DTPicker1.Value & "# group by 盘号,光碟名"
Adodc1.Refresh
End Sub
Private Sub DTPicker1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "当前系统日期"
End Sub
Private Sub Form_GotFocus()
MDIForm1.Combo1.Text = "[歌碟销售统计]"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select 盘号,光碟名,sum(出售数量) as 销售总量,sum(销售总价) as 总金额 from 销售情况表 group by 盘号,光碟名"
Adodc1.Refresh
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select sum(出售数量)as 出售总数量,sum(销售总价)as 总金额 from 销售情况表 "
Adodc2.Refresh
End Sub
Private Sub Form_Load()
MDIForm1.Combo1.Text = "[歌碟销售统计]"
DTPicker1.Value = Date
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select 盘号,光碟名,sum(出售数量) as 销售总量,sum(销售总价) as 总金额 from 销售情况表 group by 盘号,光碟名"
Adodc1.Refresh
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select sum(出售数量)as 出售总数量,sum(销售总价)as 总金额 from 销售情况表 "
Adodc2.Refresh
End Sub
Private Sub Form_LostFocus()
Unload Me
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = ""
End Sub
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "当日总销量"
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc1.Recordset.Find "光碟名='" & Text2.Text & "'"
End If
If Adodc1.Recordset.EOF = True Then
MsgBox "本日没有销售此光碟", 64, "未发现"
End If
End Sub
Private Sub Text2_LostFocus()
Adodc1.Recordset.Find "光碟名='" & Text2.Text & "'"
If Adodc1.Recordset.EOF = True Then
MsgBox "本日没有销售此光碟", 64, "未发现"
End If
Text2.Text = ""
End Sub
Private Sub Text2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "查找当日所出售的光碟"
End Sub
Private Sub Text3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MDIForm1.StatusBar1.Panels(1) = "当日总销售额"
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1:
todaysum.Hide
formpayout.Show
formpayout.Combo1.Text = "歌碟销售"
Set todaysum = Nothing
Case 4:
DataReport1.Show
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -