📄 frmyzlfind.frm
字号:
VERSION 5.00
Begin VB.Form frmYZLFind
Caption = "查找"
ClientHeight = 5655
ClientLeft = 2970
ClientTop = 2460
ClientWidth = 10695
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 5655
ScaleWidth = 10695
Begin VB.CommandButton cmdBack
Caption = "离 开"
Height = 375
Left = 360
TabIndex = 29
Top = 4800
Width = 975
End
Begin VB.CommandButton cmdFind
Caption = "查 找"
Height = 375
Left = 360
TabIndex = 28
Top = 4080
Width = 975
End
Begin VB.Frame Frame1
Caption = "精确查找"
Height = 2055
Left = 1680
TabIndex = 5
Top = 480
Width = 8175
Begin VB.OptionButton optID
Caption = "Option3"
Height = 255
Left = 360
TabIndex = 13
Top = 480
Width = 255
End
Begin VB.OptionButton optUPC
Caption = "Option4"
Height = 255
Left = 4440
TabIndex = 12
Top = 480
Width = 255
End
Begin VB.TextBox txtID
BackColor = &H8000000F&
Height = 375
Left = 1680
TabIndex = 11
Top = 390
Width = 1935
End
Begin VB.TextBox txtUPC
BackColor = &H8000000F&
Height = 375
Left = 5640
TabIndex = 10
Top = 360
Width = 1935
End
Begin VB.OptionButton optGoodsname
Caption = "Option3"
Height = 255
Left = 360
TabIndex = 9
Top = 1320
Width = 255
End
Begin VB.OptionButton optArea
Caption = "Option4"
Height = 255
Left = 4440
TabIndex = 8
Top = 1320
Width = 255
End
Begin VB.TextBox txtGoodsname
BackColor = &H8000000F&
Height = 375
Left = 1680
TabIndex = 7
Top = 1200
Width = 1935
End
Begin VB.TextBox txtArea
BackColor = &H8000000F&
Height = 375
Left = 5640
TabIndex = 6
Top = 1200
Width = 1935
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "商品号"
Height = 180
Left = 840
TabIndex = 17
Top = 480
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "国际码"
Height = 180
Left = 4920
TabIndex = 16
Top = 480
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "商品名"
Height = 180
Left = 840
TabIndex = 15
Top = 1320
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "产地"
Height = 180
Left = 4920
TabIndex = 14
Top = 1320
Width = 360
End
End
Begin VB.Frame Frame2
Caption = "模糊查找"
Height = 2295
Left = 1680
TabIndex = 4
Top = 3000
Width = 8295
Begin VB.TextBox txtM2
Height = 375
Left = 3840
MaxLength = 6
TabIndex = 27
Top = 1320
Width = 1215
End
Begin VB.TextBox txtM1
Height = 375
Left = 1680
MaxLength = 6
TabIndex = 26
Top = 1320
Width = 1215
End
Begin VB.TextBox txtK2
Height = 375
Left = 3840
MaxLength = 6
TabIndex = 21
Top = 600
Width = 1215
End
Begin VB.TextBox txtK1
Height = 375
Left = 1680
MaxLength = 6
TabIndex = 19
Top = 600
Width = 1215
End
Begin VB.Label Label15
AutoSize = -1 'True
Caption = "之间"
Height = 180
Left = 5520
TabIndex = 25
Top = 1440
Width = 360
End
Begin VB.Label Label14
Caption = "与"
Height = 255
Left = 3240
TabIndex = 24
Top = 1440
Width = 255
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "卖场数量在"
Height = 180
Left = 360
TabIndex = 23
Top = 1440
Width = 900
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "之间"
Height = 180
Left = 5520
TabIndex = 22
Top = 720
Width = 360
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "与"
Height = 180
Left = 3240
TabIndex = 20
Top = 720
Width = 180
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "库存数量在"
Height = 180
Left = 360
TabIndex = 18
Top = 720
Width = 900
End
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 255
Left = 360
TabIndex = 2
Top = 3000
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 255
Left = 360
TabIndex = 0
Top = 480
Width = 255
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "模糊查找"
Height = 180
Left = 720
TabIndex = 3
Top = 3000
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "精确查找"
Height = 180
Left = 720
TabIndex = 1
Top = 480
Width = 720
End
End
Attribute VB_Name = "frmYZLFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdBack_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
Dim strsql As String
If optID.Value = True Then '根据商品号查询
If txtId.Text = "" Then
MsgBox "请输入查询条件!", vbExclamation
txtId.SetFocus
Exit Sub
End If
strsql = "select * from t_goods where goodsid='g" & Trim(txtId.Text) & "'"
Dblink.executeSQL (strsql)
If Dblink.rs.RecordCount = 0 Then
MsgBox "对不起,您所查找的商品不存在,请重新输入!", vbInformation
txtId.SetFocus
txtId.SelStart = 0
txtId.SelLength = 9
Exit Sub
Else
Call YZLRefMSHFlexGrid(frmYZLGoods, "select goodsid '商品号',goodsname '商品名称',upc '国际码',brand '品牌',typename '商品类型',spec '商品规格',unit '销售单位',store '库存',area '产地' from t_goods where goodsid='g" & Trim(txtId.Text) & "'")
Unload Me
Exit Sub
End If
End If
If optUPC.Value = True Then '根据UPC码查询
If txtUPC.Text = "" Then
MsgBox "请输入查询条件!", vbExclamation
txtUPC.SetFocus
Exit Sub
End If
strsql = "select * from t_goods where upc='" & Trim(txtUPC.Text) & "'"
Dblink.executeSQL (strsql)
If Dblink.rs.RecordCount = 0 Then
MsgBox "对不起,您所查找的商品不存在,请重新输入!", vbInformation
txtUPC.SetFocus
txtUPC.SelStart = 0
txtUPC.SelLength = 15
Exit Sub
Else
Call YZLRefMSHFlexGrid(frmYZLGoods, "select goodsid '商品号',goodsname '商品名称',upc '国际码',brand '品牌',typename '商品类型',spec '商品规格',unit '销售单位',store '库存',area '产地' from t_goods where upc='" & Trim(txtUPC.Text) & "'")
Unload Me
Exit Sub
End If
End If
If optGoodsname.Value = True Then '根据商品名称模糊查询
If txtGoodsName.Text = "" Then
MsgBox "请输入查询条件!", vbExclamation
txtGoodsName.SetFocus
Exit Sub
End If
strsql = "select * from t_goods where goodsname like ('%" & Trim(txtGoodsName.Text) & "%')"
Dblink.executeSQL (strsql)
If Dblink.rs.RecordCount = 0 Then
MsgBox "对不起,您所查找的商品不存在,请重新输入!", vbInformation
txtGoodsName.SetFocus
txtGoodsName.SelStart = 0
txtGoodsName.SelLength = 10
Exit Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -