📄 frmshowgoodstable.frm
字号:
VERSION 5.00
Begin VB.Form frmShowGoodstable
BorderStyle = 3 'Fixed Dialog
Caption = "库存查询"
ClientHeight = 3330
ClientLeft = 45
ClientTop = 330
ClientWidth = 5805
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3330
ScaleWidth = 5805
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "显示全部现存商品"
Height = 375
Left = 240
TabIndex = 1
Top = 240
Width = 3015
End
Begin VB.Frame Frame1
Caption = "按条件查询现存商品"
Height = 2415
Left = 120
TabIndex = 0
Top = 720
Width = 5535
Begin VB.TextBox Text1
Height = 375
Left = 1080
TabIndex = 5
Top = 600
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
Left = 3840
TabIndex = 4
Top = 600
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 375
Left = 1200
TabIndex = 3
Top = 1680
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 375
Left = 3120
TabIndex = 2
Top = 1680
Width = 1215
End
Begin VB.Label Label1
Caption = "商品名称:"
Height = 495
Left = 120
TabIndex = 7
Top = 720
Width = 1215
End
Begin VB.Label Label2
Caption = "生产厂商:"
Height = 495
Left = 2880
TabIndex = 6
Top = 720
Width = 1215
End
End
End
Attribute VB_Name = "frmShowGoodstable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strgoods As String
Dim rs_goods As New ADODB.Recordset
Private Sub Command1_Click()
frmGoodsTable.Show
Unload Me
End Sub
Private Sub Command2_Click()
'当文本框为空时的屏蔽操作
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "请输入查询条件!", vbOKOnly + vbInformation, ""
Exit Sub
End If
'定义连接库存表条件时的SQL条件句
If Text1.Text = "" And Text2.Text <> "" Then
strgoods = "select * from goods where 生产厂商='" & Text2.Text & "'"
End If
If Text1.Text <> "" And Text2.Text = "" Then
strgoods = "select * from goods where 商品名称='" & Text1.Text & "'"
End If
If Text1.Text <> "" And Text2.Text <> "" Then
strgoods = "select * from goods where 商品名称='" & Text1.Text & "'and 生产厂商='" & Text2.Text & "'"
End If
rs_goods.Open strgoods, cnn, adOpenStatic, adLockOptimistic
If rs_goods.EOF = True Then
MsgBox "库存商品中不存在此种商品!", vbOKOnly + vbInformation, ""
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
rs_goods.Close
Exit Sub
Else
frmGoodsTable.Adodc1.RecordSource = strgoods
frmGoodsTable.Adodc1.Refresh
frmGoodsTable.DataGrid1.ReBind
frmGoodsTable.Show
rs_goods.Close
Unload Me
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -