【VB开源代码栏目提醒】:网学会员在VB开源代码频道为大家收集整理了main_xsfx_nxsfx.frm提供大家参考,希望对大家有所帮助!
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form main_xsfx_nxsfx
BorderStyle = 3 'Fixed Dialog
ClientHeight = 4650
ClientLeft = 45
ClientTop = 1680
ClientWidth = 9750
Icon = "main_xsfx_nxsfx.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4650
ScaleWidth = 9750
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 705
Left = 30
TabIndex = 8
Top = 495
Width = 6390
Begin VB.OptionButton Option1
Caption = "按销售数量及金额"
Height = 270
Index = 2
Left = 3840
TabIndex = 9
Top = 285
Width = 1800
End
Begin VB.OptionButton Option1
Caption = "按销售金额"
Height = 270
Index = 1
Left = 1950
TabIndex = 10
Top = 285
Width = 2700
End
Begin VB.OptionButton Option1
Caption = "按销售数量"
Height = 270
Index = 0
Left = 135
TabIndex = 11
Top = 285
Value = -1 'True
Width = 2835
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 345
Left = 90
Top = 3165
Visible = 0 'False
Width = 1665
_ExtentX = 2937
_ExtentY = 609
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_CSell"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_CSell"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Pass
word = ""
RecordSource = $"main_xsfx_nxsfx.frx":000C
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox txtEYear
Height = 300
Left = 4140
MaxLength = 4
TabIndex = 6
Top = 150
Width = 2250
End
Begin VB.TextBox txtSYear
Height = 300
Left = 930
MaxLength = 4
TabIndex = 4
Top = 150
Width = 2250
End
Begin
VB.Frame Frame3
Height = 705
Left = 6390
TabIndex = 0
Top = 495
Width = 3315
Begin VB.CommandButton cmdExit
Caption = "退出"
Height = 360
Left = 1665
TabIndex = 1
Top = 210
Width = 1500
End
Begin VB.CommandButton cmdFind
Caption = "分析"
Height = 360
Left = 180
TabIndex = 2
Top = 210
Width = 1500
End
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
Height = 3345
Left = 30
TabIndex = 7
Top = 1260
Width = 9675
_ExtentX = 17066
_ExtentY = 5900
_Version = 393216
BackColorFixed = -2147483626
SelectionMode = 1
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin VB.Label Label2
Caption = "结束年份"
Height = 225
Left = 3375
TabIndex = 5
Top = 195
Width = 735
End
Begin VB.Label Label1
Caption = "开始年份"
Height = 225
Left = 165
TabIndex = 3
Top = 195
Width = 735
End
End
Attribute VB_Name = "main_xsfx_nxsfx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public myIndex As Integer
Private Sub Form_Load()
Me.Caption = text
txtSYear = Year(Date)
txtEYear = Year(Date)
cmdFind_Click
End Sub
Private Sub Option1_Click(Index As Integer)
myIndex = Index
End Sub
Private Sub cmdFind_Click() '
查询统计
Dim r1 As Integer
If IsNumeric(txtSYear) = False Then
MsgBox "请输入正确的年份!", , "提示窗口"
txtSYear.SetFocus
Exit Sub
End If
If txtSYear < 0 Then
MsgBox "年份不能小于0!", , "提示窗口"
txtSYear.SetFocus
Exit Sub
End If
If IsNumeric(txtEYear) = False Then
MsgBox "请输入正确的年份!", , "提示窗口"
txtEYear.SetFocus
Exit Sub
End If
If txtEYear < 0 Then
MsgBox "年份不能小于0!", , "提示窗口"
txtEYear.SetFocus
Exit Sub
End If
If txtEYear < txtSYear Then
MsgBox "结束年份不能小于开始年份!", , "提示窗口"
txtEYear.SetFocus
Exit Sub
End If
Select Case myIndex
Case 0
Adodc1.RecordSource = "select 产品编号,品名规格,单位,sum(月销量) as 销售总数 from 销售表 where left(所在月份,4)>='" + txtSYear + "'and left(所在月份,4)<='" + txtEYear + "'group by 产品编号,品名规格,单位 order by 销售总数"
Adodc1.Refresh
With MSHFlexGrid1
Set .DataSource = Adodc1
.ColWidth(0) = 200
.ColWidth(1) = 2000
.ColWidth(2) = 3000
.ColWidth(3) = 1200
.ColWidth(4) = 1400
End With
Case 1
Adodc1.RecordSource = "select 产品编号,品名规格,单位,sum(月销售额) as 销售总额 from 销售表 where left(所在月份,4)>='" + tx