📄 form2.frm
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Object = "{7739C28A-7F77-4A1D-82E0-A849FB91A583}#9.0#0"; "x001.ocx"
Object = "{DAAC6951-59A4-4C08-9D6E-FE3919B64861}#1.0#0"; "FlexCell.ocx"
Begin VB.Form Form2
Caption = "供货商供货统计"
ClientHeight = 5235
ClientLeft = 60
ClientTop = 450
ClientWidth = 8220
Icon = "Form2.frx":0000
LinkTopic = "Form2"
ScaleHeight = 5235
ScaleWidth = 8220
StartUpPosition = 1 '所有者中心
Begin x001.xcombox xcombox1
Height = 315
Left = 2280
TabIndex = 2
Top = 90
Width = 1575
_ExtentX = 2778
_ExtentY = 556
Text = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin StoneXP.XPButton XPButton1
Height = 375
Left = 4080
TabIndex = 1
Top = 75
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "供货统计"
MouseIcon = "Form2.frx":000C
MousePointer = 99
End
Begin FlexCell.Grid Grid1
Height = 4815
Left = 0
TabIndex = 0
Top = 600
Width = 8295
_ExtentX = 14631
_ExtentY = 8493
Appearance = 0
Cols = 5
Rows = 30
End
Begin StoneXP.XPButton XPButton2
Height = 375
Left = 5400
TabIndex = 4
Top = 72
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "退货统计"
MouseIcon = "Form2.frx":0326
MousePointer = 99
End
Begin VB.Label Label1
Caption = "选择供货商:"
ForeColor = &H000000FF&
Height = 255
Left = 1200
TabIndex = 3
Top = 150
Width = 1095
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'作者:性灵工作室
'发布日期:2007/03/03
'描 述:简单小型超市采购系统
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Private Sub Form_Load()
Set cg2 = cnn.Execute("select 供货商 from 供货商")
xcombox1.AddItem "全部"
Do While Not cg2.EOF
xcombox1.AddItem cg2.Fields(0)
cg2.MoveNext
Loop
End Sub
Private Sub Form_Resize()
If Me.WindowState <> 1 Then
Grid1.Left = 0
Grid1.Width = Me.Width
Grid1.Top = 600
Grid1.Height = Me.Height - 1150
End If
End Sub
Private Sub xpbutton1_Click()
sql = "select 申购单.供应商,申购单明细.* from 申购单,收货单,申购单明细 where 收货单.状态<>'2'and 申购单明细.批号=收货单.采购单号 and 申购单.采购单号=收货单.采购单号"
If xcombox1.Text = "全部" Then
tj
Else
sql = sql & " and 申购单.供应商='" & xcombox1.Text & "'"
tj
Dim grow As Integer
Dim ssum As Double
grow = Grid1.Rows - 1
For i = 1 To grow
ssum = ssum + Val(Grid1.Cell(i, 5).Text)
Next
Grid1.Rows = Grid1.Rows + 1
Grid1.Cell(Grid1.Rows - 1, 4).Text = "总计数量"
Grid1.Cell(Grid1.Rows - 1, 5).Text = ssum
Grid1.Range(Grid1.Rows - 1, 1, Grid1.Rows - 1, Grid1.Cols - 1).BackColor = RGB(128, 217, 193)
End If
End Sub
Private Sub tj()
On Error GoTo finish:
Set cg2 = cnn.Execute(sql)
Grid1.Cols = 9
Grid1.Rows = 1
For i = 1 To Grid1.Cols - 1
Grid1.Cell(0, i).Text = cg2.Fields(i - 1).Name
Next
Do While Not cg2.EOF
Grid1.Rows = Grid1.Rows + 1
Grid1.Cell(Grid1.Rows - 1, 0).Text = Grid1.Rows - 1
For i = 1 To Grid1.Cols - 1
If cg2.Fields(i - 1) = Null Then
Grid1.Cell(Grid1.Rows - 1, i).Text = ""
Else
Grid1.Cell(Grid1.Rows - 1, i).Text = cg2.Fields(i - 1)
If Mid(Grid1.Cell(Grid1.Rows - 1, i).Text, 1, 1) = "." Then
Grid1.Cell(Grid1.Rows - 1, i).Text = "0" & Grid1.Cell(Grid1.Rows - 1, i).Text
End If
End If
Next
cg2.MoveNext
Loop
Exit Sub
finish:
MsgBox Err.Description
End Sub
Private Sub XPButton2_Click()
sql = "select 申购单.供应商,申购单明细.* from 申购单,收货单,申购单明细 where 收货单.状态='2'and 申购单明细.批号=收货单.采购单号 and 申购单.采购单号=收货单.采购单号"
If xcombox1.Text = "全部" Then
tj
Else
sql = sql & " and 申购单.供应商='" & xcombox1.Text & "'"
tj
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -