📄 main_kcgl_stockfind.frm
字号:
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 Column07
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 Column08
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 Column09
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
ColumnWidth = 750.047
EndProperty
BeginProperty Column01
ColumnWidth = 1695.118
EndProperty
BeginProperty Column02
ColumnWidth = 1110.047
EndProperty
BeginProperty Column03
ColumnWidth = 750.047
EndProperty
BeginProperty Column04
ColumnWidth = 464.882
EndProperty
BeginProperty Column05
ColumnWidth = 810.142
EndProperty
BeginProperty Column06
ColumnWidth = 840.189
EndProperty
BeginProperty Column07
ColumnWidth = 629.858
EndProperty
BeginProperty Column08
ColumnWidth = 659.906
EndProperty
BeginProperty Column09
ColumnWidth = 870.236
EndProperty
EndProperty
End
Begin VB.Frame Frame2
Caption = "汇总结果"
Height = 600
Left = 60
TabIndex = 3
Top = 3705
Width = 8970
Begin VB.Label Labsl
BackColor = &H00C0C0FF&
BackStyle = 0 'Transparent
ForeColor = &H00404040&
Height = 210
Left = 3480
TabIndex = 5
Top = 270
Width = 1725
End
Begin VB.Label Labpz
BackStyle = 0 'Transparent
ForeColor = &H00404040&
Height = 210
Left = 1110
TabIndex = 4
Top = 270
Width = 1230
End
Begin VB.Label Label1
BackColor = &H00C0C0FF&
BackStyle = 0 'Transparent
Caption = "品种数: 库存数量: "
Height = 255
Left = 450
TabIndex = 6
Top = 270
Width = 3060
End
End
Begin VB.Frame Frame1
Height = 690
Left = 45
TabIndex = 0
Top = -45
Width = 8955
Begin VB.ComboBox Combo2
Height = 300
ItemData = "main_kcgl_stockfind.frx":0021
Left = 1620
List = "main_kcgl_stockfind.frx":0023
Style = 2 'Dropdown List
TabIndex = 7
Top = 240
Width = 1515
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 300
Left = 3135
TabIndex = 2
Text = "Text1"
Top = 240
Width = 2985
End
Begin VB.ComboBox Combo1
BackColor = &H00FFFFFF&
Height = 300
ItemData = "main_kcgl_stockfind.frx":0025
Left = 90
List = "main_kcgl_stockfind.frx":0027
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 1515
End
Begin VB.CommandButton Comend
Caption = "退出"
Height = 360
Left = 7605
TabIndex = 9
Top = 210
Width = 1290
End
Begin VB.CommandButton Comfind
Caption = "查询"
Height = 360
Left = 6285
TabIndex = 8
Top = 210
Width = 1290
End
End
End
Attribute VB_Name = "main_kcgl_stockfind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'向combo1添加查询项目列表
Combo1.AddItem ("药品编号")
Combo1.AddItem ("药品名称")
Combo1.AddItem ("批号")
Combo1.AddItem ("规格")
Combo1.AddItem ("产地")
Combo1.ListIndex = 1
'向combo2添加查询条件列表
Combo2.AddItem ("like")
Combo2.AddItem (">")
Combo2.AddItem ("<")
Combo2.AddItem ("=")
Combo2.AddItem (">=")
Combo2.AddItem ("<=")
Combo2.AddItem ("<>")
Combo2.ListIndex = 0
End Sub
Private Sub Comfind_Click() '查询并统计库存药品信息
If Combo2.Text = "like" Then
Adodc1.RecordSource = "select * from tb_stock where tb_stock." & Combo1 & " like '%'+ '" + Text1.Text + "'+'%'"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as pz,sum(库存数量)as 数量 from tb_stock where tb_stock." & Combo1 & " like '%'+ '" + Text1.Text + "'+'%'"
Adodc2.Refresh
Else
Adodc1.RecordSource = "select * from tb_stock where tb_stock." & Combo1 & Combo2 & "'" + Text1.Text + "'"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as pz,sum(库存数量)as 数量 from tb_stock where tb_stock." & Combo1 & Combo2 & "'" + Text1.Text + "'"
Adodc2.Refresh
End If
With Adodc2.Recordset
If .Fields(0) <> "" Then Labpz.Caption = .Fields(0) Else Labpz.Caption = 0
If .Fields(1) <> "" Then Labsl.Caption = .Fields(1) Else Labsl.Caption = 0
End With
End Sub
Private Sub Comend_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -