📄 main_cxtj_ckcx.frm
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX"
Begin VB.Form main_cxtj_ckcx
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "查询统计——【出库查询】"
ClientHeight = 4155
ClientLeft = 1545
ClientTop = 1185
ClientWidth = 9000
Icon = "main_cxtj_ckcx.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4155
ScaleWidth = 9000
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame4
Height = 585
Left = 30
TabIndex = 14
Top = 3510
Width = 8925
Begin VB.TextBox Text2
BackColor = &H80000000&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 435
Locked = -1 'True
TabIndex = 18
Top = 180
Width = 990
End
Begin VB.TextBox Text3
BackColor = &H80000000&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2295
Locked = -1 'True
TabIndex = 17
Top = 180
Width = 1380
End
Begin VB.TextBox Text4
BackColor = &H80000000&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 4515
Locked = -1 'True
TabIndex = 16
Top = 180
Width = 2310
End
Begin VB.CommandButton Comend
Caption = "退出"
Height = 345
Left = 7245
TabIndex = 15
Top = 165
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "品种: 汇总数量: 汇总金额: "
Height = 300
Left = 30
TabIndex = 19
Top = 225
Width = 4695
End
End
Begin VB.Frame Frame2
Caption = "Frame3"
Height = 1305
Left = 1260
TabIndex = 0
Top = 1890
Visible = 0 'False
Width = 1335
Begin VB.Data Data3
Connect = "Access"
DatabaseName = "D:\VB数据库开发实例解析\程序\珠宝首饰进销存管理系统\zbjxc.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 105
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "sort"
Top = 840
Visible = 0 'False
Width = 1140
End
Begin VB.Data Data2
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\VB数据库开发实例解析\程序\珠宝首饰进销存管理系统\zbjxc.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 105
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "ckd"
Top = 540
Visible = 0 'False
Width = 1140
End
Begin VB.Data Data1
Connect = "Access"
DatabaseName = "D:\VB数据库开发实例解析\程序\珠宝首饰进销存管理系统\zbjxc.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 105
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "ckd"
Top = 240
Visible = 0 'False
Width = 1140
End
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "main_cxtj_ckcx.frx":000C
Height = 2355
Left = 45
OleObjectBlob = "main_cxtj_ckcx.frx":0020
TabIndex = 11
Top = 1155
Width = 8910
End
Begin VB.Frame Frame1
Caption = "设置"
Height = 1110
Left = 45
TabIndex = 1
Top = 0
Width = 8910
Begin VB.Frame Frame3
Height = 75
Left = -105
TabIndex = 13
Top = 540
Width = 8970
End
Begin VB.CommandButton Commodify
Caption = "修改"
Height = 345
Left = 7065
TabIndex = 12
Top = 675
Width = 1455
End
Begin VB.CommandButton Comdel
Caption = "删除"
Height = 345
Left = 7065
TabIndex = 10
Top = 180
Width = 1455
End
Begin VB.CommandButton Comsort
BackColor = &H00C0C0C0&
Caption = "排序"
Height = 345
Left = 5610
Style = 1 'Graphical
TabIndex = 8
Top = 180
Width = 1455
End
Begin VB.CommandButton Comfind
BackColor = &H00C0C0C0&
Caption = "查询"
Height = 345
Left = 5610
Style = 1 'Graphical
TabIndex = 6
Top = 675
Width = 1455
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 300
Left = 3285
TabIndex = 5
Text = "*"
Top = 690
Width = 2205
End
Begin VB.ComboBox Combo1
BackColor = &H00FFFFFF&
Height = 300
ItemData = "main_cxtj_ckcx.frx":189A
Left = 1185
List = "main_cxtj_ckcx.frx":189C
Style = 2 'Dropdown List
TabIndex = 4
Top = 690
Width = 1920
End
Begin VB.ComboBox Combo2
BackColor = &H00FFFFFF&
Height = 300
ItemData = "main_cxtj_ckcx.frx":189E
Left = 1200
List = "main_cxtj_ckcx.frx":18A0
Style = 2 'Dropdown List
TabIndex = 3
Top = 195
Width = 1920
End
Begin MSDBCtls.DBCombo DBCombo1
Bindings = "main_cxtj_ckcx.frx":18A2
Height = 330
Left = 3735
TabIndex = 2
Top = 195
Width = 1740
_ExtentX = 3069
_ExtentY = 582
_Version = 393216
Style = 2
BackColor = 16777215
ListField = "mc"
BoundColumn = "bz"
Text = ""
End
Begin VB.Label Label1
Caption = "设置查询:"
Height = 240
Left = 285
TabIndex = 9
Top = 750
Width = 1650
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "设置排序: 按"
ForeColor = &H00000000&
Height = 375
Left = 285
TabIndex = 7
Top = 255
Width = 3450
End
End
End
Attribute VB_Name = "main_cxtj_ckcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim x, i
Public Sub eval() '定义赋值函数
If Data2.Recordset.Fields(0) <> "" Then Text3.Text = Data2.Recordset.Fields(0) Else Text3.Text = "0"
If Data2.Recordset.Fields(2) <> "" Then Text2.Text = Data2.Recordset.Fields(2) Else Text2.Text = "0"
If Data2.Recordset.Fields(1) <> "" Then Text4.Text = Data2.Recordset.Fields(1) Else Text4.Text = "0"
End Sub
Private Sub Form_Load()
'自动识别数据库路径及数据库密码
Data1.DatabaseName = App.Path & "\zbjxc.mdb"
Data2.DatabaseName = App.Path & "\zbjxc.mdb"
Data3.DatabaseName = App.Path & "\zbjxc.mdb"
'初始化设置
DBCombo1.Text = "升序排序"
x = Array("门店名称", "编号", "简称", "商品名称", "CT", "G", "票号")
For i = 0 To 6
Combo1.AddItem (x(i))
Combo2.AddItem (x(i))
Next i
Combo1.Text = "简称"
Combo2.Text = "简称"
'统计出库信息
Data2.RecordSource = "select sum(库存)as ss,sum(金额)as ss2,count(*)as ss1 from ckd where (ckd." & Combo1.Text & " " & " like " + Chr(34) + "*" + Chr(34) + ")"
Data2.Refresh
Call eval '调用函数
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub ComFind_Click()
'查询统计出库信息
Data1.RecordSource = "select * from ckd where (ckd." & Combo1.Text & " " & "like " + Chr(34) + Text1.Text + "*" + Chr(34) + ")order by 简称,编号"
Data1.Refresh
Data2.RecordSource = "select sum(库存)as ss,sum(金额)as ss2,count(*)as ss1 from ckd where (ckd." & Combo1.Text & " " & " like " + Chr(34) + Text1.Text + "*" + Chr(34) + ")"
Data2.Refresh
Call eval '调用函数
End Sub
Private Sub ComModify_Click()
'修改出库信息
DBGrid1.AllowUpdate = True
End Sub
Private Sub Comdel_Click()
'删除出库信息
On Error Resume Next
Data1.Recordset.Delete
Data1.Refresh
Data2.Refresh
End Sub
Private Sub Comsort_Click()
'出库信息排序
Data1.RecordSource = "select * from ckd where (ckd." & Combo1.Text & " " & "like " + Chr(34) + Text1.Text + "*" + Chr(34) + ")order by " & Combo2.Text & " " & DBCombo1.BoundText
Data1.Refresh
Data2.RecordSource = "select sum(库存)as ss,sum(金额)as ss2,count(*)as ss1 from ckd where (ckd." & Combo1.Text & " " & " like " + Chr(34) + Text1.Text + "*" + Chr(34) + ")"
Data2.Refresh
Call eval '调用函数
End Sub
Private Sub Comend_Click()
frm_main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -