【VB开源代码栏目提醒】:网学会员VB开源代码为您提供E采购单分析.frm参考,解决您在E采购单分析.frm学习中工作中的难题,参考学习。
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "msdatgrd.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form E采购单分析
Caption = "采购单分析"
ClientHeight = 3690
ClientLeft = 60
ClientTop = 450
ClientWidth = 8745
LinkTopic = "Form1"
ScaleHeight = 3690
ScaleWidth = 8745
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "分析结果"
Height = 3495
Index = 0
Left = 0
TabIndex = 0
Top = 120
Width = 8655
Begin VB.OptionButton Option2
Caption = "已核销"
Height = 255
Left = 5640
TabIndex = 9
Top = 480
Value = -1 'True
Width = 855
End
Begin VB.OptionButton Option1
Caption = "未核销"
Height = 255
Left = 4680
TabIndex = 8
Top = 480
Width = 855
End
Begin VB.CommandButton CmdExit
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 360
Left = 7680
Style = 1 'Graphical
TabIndex = 2
Top = 360
Width = 800
End
Begin
VB.CommandButton CmdSearch
BackColor = &H00C0C0C0&
Caption = "查询"
Height = 360
Left = 6720
Style = 1 'Graphical
TabIndex = 1
Top = 360
Width = 800
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2535
Left = 120
TabIndex = 3
Top = 840
Width = 8415
_ExtentX = 14843
_ExtentY = 4471
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "采购单分析结果"
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 3360
TabIndex = 4
Top = 360
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
Format = 25362433
CurrentDate = 38911
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1080
TabIndex = 6
Top = 360
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
Format = 25362433
CurrentDate = 38911
End
Begin VB.Label Label8
Caption = "结束日期:"
Height = 255
Index = 2
Left = 2520
TabIndex = 7
Top = 480
Width = 1095
End
Begin VB.Label Label8
Caption = "起始日期:"
Height = 255
Index = 1
Left = 120
TabIndex = 5
Top = 480
Width = 1095
End
End
End
Attribute VB_Name = "E采购单分析"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As ADODB.Recordset
Dim SQL As String
Dim msg As String
Private Sub CmdSearch_Click()
Dim flag As String '保存
查询条件
If Option1.Value = True Then '如果选择"未核销"
flag = "未核销"
ElseIf Option2.Value = True Then '如果选择"已核销"
flag = "已核销"
End If
SQL = "SELECT 商品编号, SUM(采购数量) AS 采购数量, SUM(总共金额) AS 总共金额, SUM(不含税价) "
SQL = SQL & " AS 不含税价, SUM(税额) AS 税额 From 采购单明细表 "
SQL = SQL & " WHERE (采购单号 IN (SELECT 采购单号 From 采购单表 "
SQL = SQL & " WHERE 是否核销 = '" & flag & "' AND 采购日期 BETWEEN '"
SQL = SQL & Me.DTPicker1.Value & "' AND '" & Me.DTPicker2.Value & "')) GROUP BY 商品编号"
Set rs = SelectSQL(SQL, msg)
Set Me.DataGrid1.DataSource = rs
DataGrid1.Refresh
End Sub
Private Sub CmdExit_Click()
'退出操作
进销存
管理系统.Enabled = True
Unload Me
End Sub