📄 czkcsp.frm
字号:
VERSION 5.00
Begin VB.Form czkcsp
Caption = "查找库存商品"
ClientHeight = 2745
ClientLeft = 3990
ClientTop = 2940
ClientWidth = 5265
Icon = "czkcsp.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2745
ScaleWidth = 5265
Begin VB.Frame Frame1
Height = 2655
Left = 120
TabIndex = 0
Top = 0
Width = 5055
Begin VB.Frame Frame3
Caption = "查询内容"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 975
Left = 2280
TabIndex = 8
Top = 240
Width = 2415
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 240
TabIndex = 9
Top = 360
Width = 1935
End
End
Begin VB.CommandButton Command1
Caption = "确定(&O)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
TabIndex = 7
Top = 1800
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "取消(&C)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3600
TabIndex = 6
Top = 1800
Width = 1095
End
Begin VB.Frame Frame2
Caption = "查询主题"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 2295
Left = 120
TabIndex = 1
Top = 240
Width = 1815
Begin VB.OptionButton Option1
Caption = "商品编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Index = 0
Left = 120
TabIndex = 5
Top = 360
Width = 1335
End
Begin VB.OptionButton Option1
Caption = "商品名称"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Index = 1
Left = 120
TabIndex = 4
Top = 1320
Width = 1335
End
Begin VB.OptionButton Option2
Caption = "商品类别"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 120
TabIndex = 3
Top = 840
Width = 1335
End
Begin VB.OptionButton Option3
Caption = "库位"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 120
TabIndex = 2
Top = 1800
Width = 1095
End
End
End
End
Attribute VB_Name = "czkcsp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public a As Integer
Private Sub Command1_Click()
Dim oIndex As Integer
If Option1(0).Value = True Then oIndex = 0
If Option1(1).Value = True Then oIndex = 1
If Option2.Value = True Then oIndex = 3
If Option3.Value = True Then oIndex = 2
'查找职员
Select Case oIndex
Case 0
kcspcx.Data1.RecordSource = "select * from kczk where " & "spbh" & " = '" & Trim(Text1.Text) & "'"
kcspcx.Data2.Recordset.FindFirst "spbh" & " = '" & Trim(Text1.Text) & "'"
tmdw = kcspcx.Data2.Recordset("dw")
Case 1
kcspcx.Data2.Recordset.FindFirst "spmc" & " = '" & Trim(Text1.Text) & "'"
tmdw = kcspcx.Data2.Recordset("dw")
tmbh = Left(kcspcx.Data2.Recordset("spbh"), 1)
kcspcx.Data1.RecordSource = "select * from kczk where " & "spbh like '" & tmbh & "*" & "'"
Case 2
kcspcx.Data1.RecordSource = "select * from kczk where " & "kw" & " = '" & Trim(Text1.Text) & "'"
Case 3
'spxx.Data1.RecordSource = "select * from zyzl where " & "szbm" & " = '" & Trim(Text1.Text) & "'"
kcspcx.Data1.RecordSource = "select * from kczk where " & " spbh like '" & Left(Text1.Text, 1) & "*" & "'"
End Select
Unload Me
kcspcx.Data1.Refresh
'zyxx.Data1.Recordset.MoveFirst
If kcspcx.Data1.Recordset.BOF = True Then
MsgBox "没有找到符合条件的记录。", vbInformation, "提示"
kcspcx.Data1.RecordSource = "select * from kczk"
kcspcx.Data1.Refresh
kcspcx.Show
Unload Me
Else
kcspcx.Data1.Recordset.MoveLast
incount = kcspcx.Data1.Recordset.RecordCount
kcspcx.Data1.Recordset.MoveFirst
For i = 1 To incount
zl = zl + kcspcx.Data1.Recordset("kcsl")
kcspcx.Data1.Recordset.MoveNext
Next
kcspcx.StatusBar1.Panels(1) = "此种商品共有 " & zl & " " & tmdw
kcspcx.Data1.Recordset.MoveFirst
kcspcx.Show
End If
End Sub
Private Sub Command2_Click()
kcspcx.Data1.RecordSource = "select * from kczk"
kcspcx.Data1.Refresh
kcspcx.Show
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -