📄 frmytjb.frm
字号:
Splits(0)._ColumnProps(10)= "Column(1).Order=2"
Splits(0)._ColumnProps(11)= "Column(2).Width=3281"
Splits(0)._ColumnProps(12)= "Column(2).DividerColor=0"
Splits(0)._ColumnProps(13)= "Column(2)._WidthInPix=3175"
Splits(0)._ColumnProps(14)= "Column(2)._ColStyle=516"
Splits(0)._ColumnProps(15)= "Column(2).Order=3"
Splits(0)._ColumnProps(16)= "Column(3).Width=1826"
Splits(0)._ColumnProps(17)= "Column(3).DividerColor=0"
Splits(0)._ColumnProps(18)= "Column(3)._WidthInPix=1720"
Splits(0)._ColumnProps(19)= "Column(3)._ColStyle=516"
Splits(0)._ColumnProps(20)= "Column(3).Order=4"
Splits(0)._ColumnProps(21)= "Column(4).Width=2196"
Splits(0)._ColumnProps(22)= "Column(4).DividerColor=0"
Splits(0)._ColumnProps(23)= "Column(4)._WidthInPix=2090"
Splits(0)._ColumnProps(24)= "Column(4)._ColStyle=516"
Splits(0)._ColumnProps(25)= "Column(4).Order=5"
Splits.Count = 1
PrintInfos(0)._StateFlags= 0
PrintInfos(0).Name= "piInternal 0"
PrintInfos(0).PageHeaderFont= "Size=9,Charset=134,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=宋体"
PrintInfos(0).PageFooterFont= "Size=9,Charset=134,Weight=400,Underline=0,Italic=0,Strikethrough=0,Name=宋体"
PrintInfos(0).PageHeaderHeight= 0
PrintInfos(0).PageFooterHeight= 0
PrintInfos.Count= 1
ColumnFooters = -1 'True
DataMode = 4
DefColWidth = 0
HeadLines = 1
FootLines = 1
MultipleLines = 0
CellTipsWidth = 0
DeadAreaBackColor= 12632256
RowDividerColor = 12632256
RowSubDividerColor= 12632256
DirectionAfterEnter= 1
MaxRows = 250000
ViewColumnCaptionWidth= 0
ViewColumnWidth = 0
_PropDict = "_ExtentX,2003,3;_ExtentY,2004,3;_LayoutType,512,2;_RowHeight,16,3;_StyleDefs,513,0;_WasPersistedAsPixels,516,2"
_StyleDefs(0) = "_StyleRoot:id=0,.parent=-1,.alignment=3,.valignment=0,.bgcolor=&H80000005&"
_StyleDefs(1) = ":id=0,.fgcolor=&H80000008&,.wraptext=0,.locked=0,.transparentBmp=0"
_StyleDefs(2) = ":id=0,.fgpicPosition=0,.bgpicMode=0,.appearance=0,.borderSize=0,.ellipsis=0"
_StyleDefs(3) = ":id=0,.borderColor=&H80000005&,.borderType=0,.bold=0,.fontsize=900,.italic=0"
_StyleDefs(4) = ":id=0,.underline=0,.strikethrough=0,.charset=134"
_StyleDefs(5) = ":id=0,.fontname=宋体"
_StyleDefs(6) = "Style:id=1,.parent=0,.namedParent=33"
_StyleDefs(7) = "CaptionStyle:id=4,.parent=2,.namedParent=37"
_StyleDefs(8) = "HeadingStyle:id=2,.parent=1,.namedParent=34,.alignment=2"
_StyleDefs(9) = "FooterStyle:id=3,.parent=1,.namedParent=35,.fgcolor=&HFF0000&"
_StyleDefs(10) = "InactiveStyle:id=5,.parent=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&"
_StyleDefs(11) = "SelectedStyle:id=6,.parent=1,.namedParent=36"
_StyleDefs(12) = "EditorStyle:id=7,.parent=1"
_StyleDefs(13) = "HighlightRowStyle:id=8,.parent=1,.namedParent=38"
_StyleDefs(14) = "EvenRowStyle:id=9,.parent=1,.namedParent=39"
_StyleDefs(15) = "OddRowStyle:id=10,.parent=1,.namedParent=40"
_StyleDefs(16) = "RecordSelectorStyle:id=11,.parent=2,.namedParent=41"
_StyleDefs(17) = "FilterBarStyle:id=12,.parent=1,.namedParent=42"
_StyleDefs(18) = "Splits(0).Style:id=13,.parent=1"
_StyleDefs(19) = "Splits(0).CaptionStyle:id=22,.parent=4"
_StyleDefs(20) = "Splits(0).HeadingStyle:id=14,.parent=2"
_StyleDefs(21) = "Splits(0).FooterStyle:id=15,.parent=3"
_StyleDefs(22) = "Splits(0).InactiveStyle:id=16,.parent=5"
_StyleDefs(23) = "Splits(0).SelectedStyle:id=18,.parent=6"
_StyleDefs(24) = "Splits(0).EditorStyle:id=17,.parent=7"
_StyleDefs(25) = "Splits(0).HighlightRowStyle:id=19,.parent=8"
_StyleDefs(26) = "Splits(0).EvenRowStyle:id=20,.parent=9"
_StyleDefs(27) = "Splits(0).OddRowStyle:id=21,.parent=10"
_StyleDefs(28) = "Splits(0).RecordSelectorStyle:id=23,.parent=11"
_StyleDefs(29) = "Splits(0).FilterBarStyle:id=24,.parent=12"
_StyleDefs(30) = "Splits(0).Columns(0).Style:id=28,.parent=13"
_StyleDefs(31) = "Splits(0).Columns(0).HeadingStyle:id=25,.parent=14"
_StyleDefs(32) = "Splits(0).Columns(0).FooterStyle:id=26,.parent=15"
_StyleDefs(33) = "Splits(0).Columns(0).EditorStyle:id=27,.parent=17"
_StyleDefs(34) = "Splits(0).Columns(1).Style:id=102,.parent=13"
_StyleDefs(35) = "Splits(0).Columns(1).HeadingStyle:id=99,.parent=14"
_StyleDefs(36) = "Splits(0).Columns(1).FooterStyle:id=100,.parent=15"
_StyleDefs(37) = "Splits(0).Columns(1).EditorStyle:id=101,.parent=17"
_StyleDefs(38) = "Splits(0).Columns(2).Style:id=32,.parent=13"
_StyleDefs(39) = "Splits(0).Columns(2).HeadingStyle:id=29,.parent=14"
_StyleDefs(40) = "Splits(0).Columns(2).FooterStyle:id=30,.parent=15"
_StyleDefs(41) = "Splits(0).Columns(2).EditorStyle:id=31,.parent=17"
_StyleDefs(42) = "Splits(0).Columns(3).Style:id=94,.parent=13"
_StyleDefs(43) = "Splits(0).Columns(3).HeadingStyle:id=91,.parent=14"
_StyleDefs(44) = "Splits(0).Columns(3).FooterStyle:id=92,.parent=15"
_StyleDefs(45) = "Splits(0).Columns(3).EditorStyle:id=93,.parent=17"
_StyleDefs(46) = "Splits(0).Columns(4).Style:id=70,.parent=13"
_StyleDefs(47) = "Splits(0).Columns(4).HeadingStyle:id=67,.parent=14"
_StyleDefs(48) = "Splits(0).Columns(4).FooterStyle:id=68,.parent=15"
_StyleDefs(49) = "Splits(0).Columns(4).EditorStyle:id=69,.parent=17"
_StyleDefs(50) = "Named:id=33:Normal"
_StyleDefs(51) = ":id=33,.parent=0"
_StyleDefs(52) = "Named:id=34:Heading"
_StyleDefs(53) = ":id=34,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&"
_StyleDefs(54) = ":id=34,.wraptext=-1"
_StyleDefs(55) = "Named:id=35:Footing"
_StyleDefs(56) = ":id=35,.parent=33,.valignment=2,.bgcolor=&H8000000F&,.fgcolor=&H80000012&"
_StyleDefs(57) = "Named:id=36:Selected"
_StyleDefs(58) = ":id=36,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&"
_StyleDefs(59) = "Named:id=37:Caption"
_StyleDefs(60) = ":id=37,.parent=34,.alignment=2"
_StyleDefs(61) = "Named:id=38:HighlightRow"
_StyleDefs(62) = ":id=38,.parent=33,.bgcolor=&H8000000D&,.fgcolor=&H8000000E&"
_StyleDefs(63) = "Named:id=39:EvenRow"
_StyleDefs(64) = ":id=39,.parent=33,.bgcolor=&HFFFF00&"
_StyleDefs(65) = "Named:id=40:OddRow"
_StyleDefs(66) = ":id=40,.parent=33"
_StyleDefs(67) = "Named:id=41:RecordSelector"
_StyleDefs(68) = ":id=41,.parent=34"
_StyleDefs(69) = "Named:id=42:FilterBar"
_StyleDefs(70) = ":id=42,.parent=33"
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "销售统计表"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 555
Index = 1
Left = 4980
TabIndex = 1
Top = 240
Width = 2895
End
End
Attribute VB_Name = "FrmYTJB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rstmp As New ADODB.Recordset
Dim X As New XArrayDB
Dim gUpperBound As Integer
Private strQuery(1) As String
Private strSubQuery(3) As String
Dim blnOrder(4) As Boolean
Private Sub chkFields_Click(Index As Integer)
Select Case Index
Case 2
If chkFields(2).Value = 1 Then
chkFields(3).Visible = True
cmbFields(2).Visible = True
chkFields(3).Value = 0
Else
chkFields(3).Visible = False
cmbFields(2).Visible = False
Call clearAll
End If
Case 1
If chkFields(1).Value = 1 Then
dtpDate(2).Visible = True
Else
dtpDate(2).Visible = False
Call clearAll
End If
End Select
End Sub
Public Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub Command1_Click(Index As Integer)
Dim sqlstring As String
Dim rstmp As New ADODB.Recordset
Dim rsNewTmp As New ADODB.Recordset
Dim i As Integer
Dim YYYY As String
For i = 0 To 3
strSubQuery(i) = ""
Next i
Select Case Index
Case 0
'制品类型
If chkFields(2).Value = 1 And Trim(cmbFields(1).Text) <> "" Then
strSubQuery(0) = "t1.ChrProduceType = '" & Trim(cmbFields(1).Text) & "' "
End If
'图书类型
If chkFields(3).Value = 1 And Trim(cmbFields(2).Text) <> "" Then
strSubQuery(1) = "t2.ChrBookType = '" & Trim(cmbFields(2).Text) & "' "
End If
Dim strYear As String
Dim strMonth As String
strYear = Format(dtpDate(2).Value, "yyyy")
strMonth = IIf(Format(dtpDate(2).Value, "mm") >= 10, Format(dtpDate(2).Value, "mm"), Int(Format(dtpDate(2).Value, "mm")))
'日期类型
If chkFields(1).Value = 1 And Trim(cmbFields(0).Text) <> "" Then
Select Case cmbFields(0).Text
Case "年份"
If Trim(cmbFields(0).Text) = "年份" Then
strSubQuery(2) = " year(t3.Datdate) ='" & strYear & "' "
End If
Case "月份"
If Trim(cmbFields(0).Text) = "月份" Then
strSubQuery(2) = "year(t3.Datdate) ='" & strYear & "' And month(t3.Datdate)= '" & strMonth & " '"
End If
' Case "周"
' If Trim(cmbFields(0).Text) = "周" Then
'' strsubQuery(2) = "(T3.DatDate between #" & Format(dtpDate(0).Value, "yyyy-mm-dd") & "# and #" & Format(dtpDate(1).Value, "yyyy-mm-dd") & "#)"
'
' End If
End Select
End If
'日期
If chkFields(0).Value = 1 Then
strSubQuery(3) = "(T3.DatDate between #" & Format(dtpDate(0).Value, "yyyy-mm-dd") & "# and #" & Format(dtpDate(1).Value, "yyyy-mm-dd") & "#)"
End If
If dtpDate(0).Value > dtpDate(1).Value Then
MsgBox "请正确选择时间!", vbInformation
Exit Sub
End If
strQuery(0) = "where "
For i = 0 To 3
If Trim(strSubQuery(i)) <> "" Then
strQuery(0) = strQuery(0) & strSubQuery(i) & " and "
End If
Next
If Trim(strQuery(0)) = "where" Then
strQuery(0) = strQuery(0) & " 2=2 and "
End If
strQuery(0) = Mid(strQuery(0), 1, Len(strQuery(0)) - 4)
If Trim(strQuery(0)) = "where" Then '没选任何条件
Exit Sub
Else
sqlstring = "select t3.Datdate,t1.chrproduceType,t2.chrbooktype,sum(t1.IntAmount) as IntAmount," & _
"sum(t1.DecSum) as DecSum from (SellTable_List t1 left join bookdata t2 ON " & _
"t1.chrbookno=t2.chrbookno and t1.chrbookname=t2.chrbookname) left join selltable " & _
"t3 ON t1.chrsellno=t3.chrsellno " & strQuery(0) & ""
If chkFields(4).Value = 1 Then
If Trim(cmbFields(3).Text) = "以销售数量排" Then
sqlstring = sqlstring & "group by t3.Datdate,t1.chrproduceType,t2.chrbooktype order by sum(t1.IntAmount) desc"
Else
sqlstring = sqlstring & "group by t3.Datdate,t1.chrproduceType,t2.chrbooktype order by sum(t1.DecSum) desc"
End If
Else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -