📄 商品日进销存查询.frm
字号:
TabIndex = 28
Top = 2700
Width = 2295
End
Begin VB.TextBox Text3
Height = 375
Index = 2
Left = 2040
TabIndex = 26
Top = 1470
Width = 3915
End
Begin VB.TextBox Text3
Height = 375
Index = 1
Left = 2040
TabIndex = 25
Top = 870
Width = 3915
End
Begin VB.TextBox Text3
Height = 375
Index = 0
Left = 2040
TabIndex = 24
Top = 210
Width = 3915
End
Begin VB.Label Label3
Caption = " 销售数量:"
Height = 315
Index = 7
Left = 570
TabIndex = 23
Top = 4560
Width = 1635
End
Begin VB.Label Label3
Caption = " 折扣率:"
Height = 315
Index = 6
Left = 570
TabIndex = 22
Top = 3960
Width = 1635
End
Begin VB.Label Label3
Caption = " 商品税率:"
Height = 315
Index = 5
Left = 570
TabIndex = 21
Top = 3390
Width = 1635
End
Begin VB.Label Label3
Caption = " 商品货号:"
Height = 315
Index = 4
Left = 570
TabIndex = 20
Top = 2820
Width = 1635
End
Begin VB.Label Label3
Caption = "商品经营方式:"
Height = 315
Index = 3
Left = 660
TabIndex = 19
Top = 2160
Width = 1635
End
Begin VB.Label Label3
Caption = "供应商编码:"
Height = 315
Index = 2
Left = 570
TabIndex = 18
Top = 1560
Width = 1635
End
Begin VB.Label Label3
Caption = " 商品名称:"
Height = 315
Index = 1
Left = 570
TabIndex = 17
Top = 930
Width = 1635
End
Begin VB.Label Label3
Caption = "连锁店编码:"
Height = 315
Index = 0
Left = 570
TabIndex = 11
Top = 330
Width = 1635
End
End
End
Attribute VB_Name = "search"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer
Private Sub Cal_Click()
If i = 0 Then Text1.Text = Cal.Year & "-" & Cal.Month & "-" & Cal.Day
If i = 1 Then Text2.Text = Cal.Year & "-" & Cal.Month & "-" & Cal.Day
Cal.Visible = False
End Sub
'VB 在线
'www.VBzx.net
' VB在线 收集整理
'+------------------------------------------------+
' http://www.VBzx.net
'+------------------------------------------------+
Private Sub Command1_Click()
Dim txtSQL(0 To 7) As String
Dim mrc As ADODB.Recordset
Dim MsgText As String
Static miCount As Integer
'ToDo: create test for correct password
'check for correct password
If Trim(Text3(0).Text) = "" And Trim(Text3(1).Text) = "" And Trim(Text3(2).Text) = "" And Trim(Text4.Text) = "" And Trim(Text5(0).Text) = "" And Trim(Text5(1).Text) = "" And Combo1(1).Text = "" And Combo1(0).Text = "" Then
MsgBox "没有选择查询条件!"
Exit Sub
End If
If Check1(0).Value = 0 And Check1(1).Value = 0 And Check1(2).Value = 0 And Check1(3).Value = 0 And Check1(4).Value = 0 And Check1(5).Value = 0 And Check1(6).Value = 0 And Check1(7).Value = 0 Then
MsgBox "没有选择查询条件!"
Exit Sub
End If
If Check1(0).Value = 1 Then
txtSQL(0) = "select * from 商品销售信息表 where 连锁店编码 = '" & Text3(0).Text & "'"
Set mrc = ExecuteSQL(txtSQL(0), MsgText)
If mrc.EOF = True Then
MsgBox "没有符合条件的连锁店加盟!", vbOKOnly + vbExclamation, "警告"
End If
End If
If Check1(1).Value = 1 Then
txtSQL(1) = "select * from 商品销售信息表 where 商品名称 = '" & Text3(1).Text & "'"
Set mrc = ExecuteSQL(txtSQL(1), MsgText)
If mrc.EOF = True Then
MsgBox "对不起,没有符合条件的商品!", vbOKOnly + vbExclamation, "警告"
End If
End If
If Check1(2).Value = 1 Then
txtSQL(2) = "select * from商品销售信息表 where 供应商编码 = '" & Text3(2).Text & "'"
Set mrc = ExecuteSQL(txtSQL(2), MsgText)
If mrc.EOF = True Then
MsgBox "对不起,没有符合条件供应商的纪录!", vbOKOnly + vbExclamation, "警告"
End If
End If
If Check1(3).Value = 1 Then
txtSQL(3) = "select * from 商品销售信息表 where 商品经营方式 = '" & Combo1(0).Text & "'"
Set mrc = ExecuteSQL(txtSQL(3), MsgText)
If mrc.EOF = True Then
MsgBox "对不起,暂缺!", vbOKOnly + vbExclamation, "警告"
End If
End If
If Check1(4).Value = 1 Then
txtSQL(4) = "select * from 商品销售信息表 where 商品货号 = '" & Text4.Text & "'"
Set mrc = ExecuteSQL(txtSQL(4), MsgText)
If mrc.EOF = True Then
MsgBox "对不起,没有符合条件的商品货号!", vbOKOnly + vbExclamation, "警告"
End If
End If
If Check1(5).Value = 1 Then
txtSQL(5) = "select * from 商品销售信息表 where 商品税率 = '" & Combo1(1).Text & "'"
Set mrc = ExecuteSQL(txtSQL(5), MsgText)
If mrc.EOF = True Then
MsgBox "恭喜,此商品从目前的情况来看不用交税!", vbOKOnly + vbExclamation, "警告"
End If
End If
If Check1(6).Value = 1 Then
txtSQL(6) = "select * from 商品销售信息表 where 折扣率 = '" & Text5(0).Text & "'"
Set mrc = ExecuteSQL(txtSQL(6), MsgText)
If mrc.EOF = True Then
MsgBox "此商品没有折扣率!", vbOKOnly + vbExclamation, "警告"
End If
End If
If Check1(7).Value = 1 Then
txtSQL(7) = "select * from 商品销售信息表 where 销售数量 = '" & Text5(1).Text & "'"
Set mrc = ExecuteSQL(txtSQL(7), MsgText)
If mrc.EOF = True Then
MsgBox "非常不幸,此商品还没有销售过,加油!", vbOKOnly + vbExclamation, "警告"
End If
End If
Dim txt1 As String
If Trim(Text1.Text) = "" And Trim(Text1.Text) = "" Then
MsgBox "没有选择日期", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
txt1 = "select * from 商品销售信息表 where 进货日期<='trim(text2.text)' And 进货日期 >= 'trim(text1.text)'"
sqlresult.txtSQL = txtSQL(0) & txtSQL(1) & txtSQL(2) & txtSQL(3) & txtSQL(4) & txtSQL(5) & txtSQL(6) & txtSQL(7) & txt1
sqlresult.Show
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click(Index As Integer)
i = 0
Cal.Visible = True
Cal.Left = Command3(0).Left
End Sub
Private Sub Command4_Click()
i = 1
Cal.Visible = True
Cal.Left = Frame2.Width - Cal.Width
End Sub
Private Sub Form_Load()
Cal.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -