【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“main_xsfx_jxsfx.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_jxsfx
BorderStyle = 3 'Fixed Dialog
ClientHeight = 4695
ClientLeft = 45
ClientTop = 1680
ClientWidth = 9750
Icon = "main_xsfx_jxsfx.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4695
ScaleWidth = 9750
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 705
Left = 45
TabIndex = 8
Top = 540
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 VB.TextBox txtQuarter
Height = 300
Left = 4140
MaxLength = 1
TabIndex = 6
Top = 150
Width = 2250
End
Begin VB.TextBox txtYear
Height = 300
Left = 930
MaxLength = 4
TabIndex = 4
Top = 150
Width = 2250
End
Begin
VB.Frame Frame3
Height = 705
Left = 6405
TabIndex = 0
Top = 540
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 MSAdodcLib.Adodc Adodc1
Height = 345
Left = 105
Top = 3210
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_jxsfx.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 MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
Height = 3345
Left = 45
TabIndex = 7
Top = 1305
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 = 210
Width = 735
End
Begin VB.Label Label1
Caption = "统计年份"
Height = 225
Left = 165
TabIndex = 3
Top = 210
Width = 735
End
End
Attribute VB_Name = "main_xsfx_jxsfx"
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
txtYear = Year(Date)
txtQuarter = "1"
cmdFind_Click
End Sub
Private Sub Option1_Click(Index As Integer)
myIndex = Index
End Sub
Private Sub txtQuarter_GotFocus()
txtQuarter.SelStart = 0
txtQuarter.SelLength = Len(txtYear)
End Sub
Private Sub txtYear_GotFocus()
txtYear.SelStart = 0
txtYear.SelLength = Len(txtYear)
End Sub
Private Sub txtYear_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then txtQuarter.SetFocus
End Sub
Private Sub cmdFind_Click() '
查询统计
Dim r1 As Integer
Dim sql As String
If IsNumeric(txtYear) = False Then
MsgBox "请输入正确的年份!", , "提示窗口"
txtYear.SetFocus
Exit Sub
End If
If txtYear < 0 Then
MsgBox "年份不能小于0!", , "提示窗口"
txtYear.SetFocus
Exit Sub
End If
If IsNumeric(txtQuarter) = False Then
MsgBox "请输入正确的季度!", , "提示窗口"
txtQuarter.SetFocus
Exit Sub
End If
If txtQuarter > 4 < 0 Then
MsgBox "季度不能大于4或小于0!", , "提示窗口"
txtQuarter.SetFocus
Exit Sub
End If
Select Case txtQuarter.text
Case 1
sql = "right(所在月份,2)='01' or right(所在月份,2)='02' or right(所在月份,2)='03'"
Case 2
sql = "right(所在月份,2)='04' or right(所在月份,2)='05' or right(所在月份,2)='06'"
Case 3
sql = "right(所在月份,2)='07' or right(所在月份,2)='08' or right(所