📄 njb.frm
字号:
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 2160
Top = 0
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=dzqch"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "dzqch"
OtherAttributes = ""
UserName = "sa"
Password = ""
RecordSource = "select DISTINCT hwm from hwmk order by hwm"
Caption = "Adodc3"
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 MSAdodcLib.Adodc Adodc4
Height = 330
Left = 0
Top = 0
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=dzqch"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "dzqch"
OtherAttributes = ""
UserName = "sa"
Password = ""
RecordSource = "select * from ma where dw like '%重车%'"
Caption = "Adodc2"
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.Label Label3
Caption = "制表人"
Height = 375
Left = 840
TabIndex = 8
Top = 7320
Width = 855
End
Begin VB.Label Label4
Caption = "本年累计"
Height = 255
Left = 4560
TabIndex = 7
Top = 7320
Visible = 0 'False
Width = 1335
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "销售统计表"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 600
TabIndex = 2
Top = 120
Width = 7455
End
Begin VB.Menu prin
Caption = "文件"
Begin VB.Menu mnuoutput
Caption = "导出"
End
Begin VB.Menu mnuPreview
Caption = "打印预览"
End
Begin VB.Menu mnuPrint
Caption = "打印"
End
Begin VB.Menu mnunull
Caption = "-"
End
Begin VB.Menu mnuExit
Caption = "关闭"
End
End
Begin VB.Menu mnuManual
Caption = "编码控制预览"
Enabled = 0 'False
Begin VB.Menu mnuPageUp
Caption = "上页"
End
Begin VB.Menu mnuPageDown
Caption = "下页"
End
Begin VB.Menu mnuZoom
Caption = "显示比例"
End
Begin VB.Menu mnuPaperSize
Caption = "选择纸张"
End
Begin VB.Menu mnuOrientation
Caption = "纸张方向"
End
End
Begin VB.Menu hlp
Caption = "帮助"
Begin VB.Menu about
Caption = "关于"
End
Begin VB.Menu neirong
Caption = "内容"
End
End
Begin VB.Menu tuichu
Caption = "退出"
Begin VB.Menu quit
Caption = "退出"
End
End
End
Attribute VB_Name = "njb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
Dim listindex1
Dim listindex2
Option Explicit
Private Const MARGIN_SIZE = 60 ' 单位为缇
' 列拖拽变量
Dim sj, drq
Private m_bDragOK As Boolean
Private m_iDragCol As Integer
Private xdn As Integer, ydn As Integer
Dim sj1, sj2 As String
Dim le%, istr%
Dim ljsj
Dim ljfz
Dim i, j
Dim jl_sql As String
'##################################################################
'## 过程名称:Command1_Click
'## 参数: 无
'##################################################################
Private Sub Command1_Click()
Label2.Caption = Format(DTPicker1.Value, "yyyy年mm月") & "销售统计表"
Adodc1.RecordSource = "SELECT DISTINCT " & jl_sqlstr & ".fhr AS 货主姓名, htk.hth AS 发运票号, htk.htl AS 合同量, htk.hwm AS 煤种, SUM(" & jl_sqlstr & ".jz) AS 本月发运量, htk.yfl AS 累计发量, htk.wfl AS 欠存量, htk.sj AS 开票时间, htk.fhdw AS 发货单位 FROM " & jl_sqlstr & " INNER JOIN htk ON " & jl_sqlstr & ".hth = htk.hth where " & jl_sqlstr & ".sj like '%" & Format(DTPicker1.Value, "yyyy-mm") & "%' GROUP BY htk.fhdw," & jl_sqlstr & ".fhr, htk.hth,htk.htl, htk.hwm , htk.yfl, htk.wfl, htk.sj"
Adodc1.refresh
'adodcEnvironment1.Command1 refrash
MSHFlexGrid1.refresh
End Sub
'##################################################################
'## 过程名称:Command3_Click
'## 参数: 无
'##################################################################
Private Sub Command3_Click()
Unload Me
Me.Picture2.Visible = True
Me.MSHFlexGrid1.Visible = False
End Sub
Private Sub about_Click()
'frmAbout.Show
End Sub
'##################################################################
'## 过程名称:Command4_Click
'## 参数: 无
'##################################################################
Private Sub Command4_Click()
Me.Picture2.Visible = True
Me.MSHFlexGrid1.Visible = False
End Sub
'##################################################################
'## 过程名称:Command5_Click
'## 参数: 无
'##################################################################
Private Sub Command5_Click()
On Error Resume Next
List2.AddItem List1.List(listindex1)
List1.RemoveItem listindex1
End Sub
'##################################################################
'## 过程名称:Command6_Click
'## 参数: 无
'##################################################################
Private Sub Command6_Click()
On Error Resume Next
Dim li
Dim jj
li = List1.listcount
For jj = 1 To li
List2.AddItem List1.List(jj)
Next jj
End Sub
'##################################################################
'## 过程名称:Command7_Click
'## 参数: 无
'##################################################################
Private Sub Command7_Click()
On Error Resume Next
List1.AddItem List2.List(listindex2)
List2.RemoveItem listindex2
End Sub
'##################################################################
'## 过程名称:Command9_Click
'## 参数: 无
'##################################################################
Private Sub Command9_Click()
Dim sql As String
Me.Picture2.Visible = False
Me.MSHFlexGrid1.Visible = True
Dim li, jj
li = List2.listcount
If li = 0 Then
sql = "*"
Else
sql = "'"
For jj = 0 To li - 2
sql = sql & Trim(List2.List(jj)) & "','"
Next
sql = sql & Trim(List2.List(li - 1)) & "'"
End If
Dim sj1, sj2 As String * 10
Me.Label2.Caption = Format(Me.DTPicker1.Value, "yyyy年") & "汽运销售报表"
sj1 = Format(Me.DTPicker1.Value, "yyyy")
MSHFlexGrid1.refresh
Adodc1.ConnectionTimeout = 15
Adodc1.ConnectionString = "dsn=dzqch"
Adodc1.RecordSource = " SELECT htk.fhdw AS 发货单位,htk.hth as 票号, htk.htl AS 开票数量,htk.sj AS 开票时间, htk.hwm AS 煤种, SUM(" _
& jl_sqlstr & ".jz) AS 本年发运量, htk.yfl AS 累计发量, htk.wfl AS 欠存量," _
& " FROM " & jl_sqlstr & " INNER JOIN htk ON htk.hth = " _
& jl_sqlstr & ".hth where " & jl_sqlstr & ".sj like'%" _
& jl_sqlstr & ".zflj=1 and " _
& sj1 & "%' and " & jl_sqlstr & ".hwm in (" & sql & ") group BY htk.bz,htk.fhdw, " _
& " htk.hth, htk.htl, htk.hwm, htk.yfl, htk.wfl, htk.sj"
'''''''''''''''''''''
Adodc1.refresh
Set MSHFlexGrid1.DataSource = Adodc1
MSHFlexGrid1.refresh
Me.mnuoutput.Enabled = True
Call js
' Adodc1.ConnectionString = ""
End Sub
'##################################################################
'## 过程名称:Form_Load
'## 参数: 无
'##################################################################
Private Sub Form_Load()
With Me.MSHFlexGrid1
.Row = 0
.ColWidth(0) = 2400
.ColWidth(1) = 1000
.ColWidth(2) = 1000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 1000
.ColWidth(6) = 1000
.ColWidth(7) = 1000
.ColWidth(8) = 1000
.ColWidth(9) = 1000
.ColWidth(10) = 1000
End With
Me.DTPicker1.Value = Now
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -