📄 frmdailyreport.frm
字号:
VERSION 5.00
Object = "{B02F3647-766B-11CE-AF28-C3A2FBE76A13}#2.5#0"; "SS32X25.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmdailyreport
Caption = "Tank daily cost"
ClientHeight = 6510
ClientLeft = 60
ClientTop = 345
ClientWidth = 8970
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6510
ScaleWidth = 8970
WindowState = 2 'Maximized
Begin VB.CommandButton Command1
Caption = "Exit"
Height = 375
Left = 6840
TabIndex = 14
Top = 5280
Width = 1215
End
Begin VB.Frame Frame1
Height = 2775
Left = 120
TabIndex = 3
Top = 0
Width = 6375
Begin VB.ComboBox cmb_tank
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 8
Top = 1920
Width = 1575
End
Begin VB.ComboBox cmb_pro
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 5
Top = 1080
Width = 1575
End
Begin VB.ComboBox cmb_cus
Height = 300
Left = 3840
Style = 2 'Dropdown List
TabIndex = 4
Top = 1080
Width = 1575
End
Begin MSComCtl2.DTPicker DTtime2
Height = 375
Left = 3840
TabIndex = 6
Top = 240
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 24510465
CurrentDate = 37145
End
Begin MSComCtl2.DTPicker DTtime1
Height = 375
Left = 960
TabIndex = 7
Top = 240
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 24510465
CurrentDate = 37145
End
Begin VB.Label Label1
Caption = "Tank Code:"
Height = 375
Left = 240
TabIndex = 13
Top = 1800
Width = 495
End
Begin VB.Label Label2
Caption = "From:"
Height = 255
Left = 360
TabIndex = 12
Top = 360
Width = 495
End
Begin VB.Label Label3
Caption = "To:"
Height = 255
Left = 3480
TabIndex = 11
Top = 360
Width = 375
End
Begin VB.Label Label4
Caption = "Product Code:"
Height = 375
Left = 120
TabIndex = 10
Top = 960
Width = 615
End
Begin VB.Label Label5
Caption = "Customer Code:"
Height = 375
Left = 3000
TabIndex = 9
Top = 960
Width = 735
End
End
Begin FPSpread.vaSpread vasreport
Height = 2655
Left = 120
TabIndex = 2
Top = 3000
Width = 6375
_Version = 131077
_ExtentX = 11245
_ExtentY = 4683
_StockProps = 64
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MaxCols = 0
MaxRows = 0
SpreadDesigner = "frmdailyreport.frx":0000
End
Begin VB.CommandButton cmd_exc
Caption = "Exchange"
Height = 375
Left = 6840
TabIndex = 1
Top = 3720
Width = 1215
End
Begin VB.CommandButton cmd_ok
Caption = "O K"
Height = 375
Left = 6840
TabIndex = 0
Top = 2400
Width = 1215
End
End
Attribute VB_Name = "frmdailyreport"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Base 1
Private Sub cmb_pro_Validate(Cancel As Boolean)
Dim sSQL As String
Dim rsttank As Recordset
If cmb_pro.Text = "" Then
Exit Sub
End If
sSQL = "select distinct cuscode,tnkcode from iltank where procode = " & CLng(cmb_pro.Text)
Set rsttank = Acs_cnt.Execute(sSQL)
cmb_cus.Clear
cmb_tank.Clear
Do While Not rsttank.EOF
cmb_cus.AddItem (rsttank!cuscode)
cmb_tank.AddItem (rsttank!tnkcode)
rsttank.MoveNext
Loop
cmb_cus.ListIndex = 0
cmb_tank.ListIndex = 0
rsttank.Close
Set rsttank = Nothing
End Sub
Private Sub cmb_cus_Validate(Cancel As Boolean)
Dim sSQL As String
Dim rsttank As Recordset
If cmb_cus.Text = "" Then
Exit Sub
End If
sSQL = "select distinct tnkcode from iltank where cuscode = " & CLng(cmb_cus.Text) & "and procode = " & CLng(cmb_pro.Text)
Set rsttank = Acs_cnt.Execute(sSQL)
cmb_tank.Clear
rsttank.MoveFirst
Do While Not rsttank.EOF
cmb_tank.AddItem (rsttank!tnkcode)
rsttank.MoveNext
Loop
cmb_tank.ListIndex = 0
rsttank.Close
Set rattank = Nothing
End Sub
Private Sub cmb_tank_Validate(Cancel As Boolean)
Dim sSQL As String
Dim rsttank As Recordset
Dim procode, cuscode As String
Dim i As Long
If cmb_tank.Text = "" Then
Exit Sub
End If
sSQL = "select distinct cuscode,procode from iltank where tnkcode = " & CLng(cmb_tank.Text)
Set rsttank = Acs_cnt.Execute(sSQL)
procode = rsttank!procode
cuscode = rsttank!cuscode
For i = 0 To cmb_pro.ListCount - 1
cmb_pro.ListIndex = i
If cmb_pro.Text = procode Then
Exit For
End If
Next
For i = 0 To cmb_cus.ListCount - 1
cmb_cus.ListIndex = i
If cmb_cus.Text = cuscode Then
Exit For
End If
Next
rsttank.Close
Set rsttank = Nothing
End Sub
Private Sub cmd_ok_Click()
Dim date1, date2 As Long
Dim sSQL As String
Dim rsttank As Recordset
Dim lrow As Long
Dim lastact As Long
Dim sumcost As Long
Dim days As Long
Dim avgcost As Long
Dim sdate1, sdate2 As String
If cmb_cus.Text = "" Or cmb_pro.Text = "" Or cmb_tank.Text = "" Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -