📄 frmsbyowner.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmSByOwner
Caption = "按业主收费统计"
ClientHeight = 8175
ClientLeft = 60
ClientTop = 345
ClientWidth = 10095
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8175
ScaleWidth = 10095
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 615
Left = 120
TabIndex = 2
Top = 0
Width = 9855
Begin MSDataListLib.DataCombo dco_Unit
Height = 330
Left = 4080
TabIndex = 3
Top = 180
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin MSDataListLib.DataCombo dco_Bld
Height = 330
Left = 1080
TabIndex = 4
Top = 165
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin MSDataListLib.DataCombo dco_Room
Height = 330
Left = 6960
TabIndex = 5
Top = 165
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "楼房单元"
Height = 180
Left = 3240
TabIndex = 8
Top = 240
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "楼房编号"
Height = 180
Left = 240
TabIndex = 7
Top = 240
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "房间号码"
Height = 180
Left = 6120
TabIndex = 6
Top = 240
Width = 720
End
End
Begin VB.CommandButton Cmd_Back
Caption = "返 回"
Height = 495
Left = 4320
TabIndex = 1
Top = 7440
Width = 1455
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 6495
Left = 120
TabIndex = 0
Top = 720
Width = 9855
_ExtentX = 17383
_ExtentY = 11456
_Version = 393216
AllowUpdate = 0 'False
AllowArrows = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 120
Top = 7320
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 2
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 MSAdodcLib.Adodc Ado_Bld
Height = 330
Left = 6600
Top = 7320
Visible = 0 'False
Width = 2415
_ExtentX = 4260
_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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Ado_Bld"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Ado_Unit
Height = 330
Left = 4560
Top = 7320
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Ado_Unit"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Ado_Room
Height = 330
Left = 2040
Top = 7320
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Ado_Room"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "FrmSByOwner"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub dco_Bld_Click(Area As Integer)
If Len(Trim(dco_Bld.Text)) > 0 Then
Ado_Unit.ConnectionString = Conn
Ado_Unit.RecordSource = "Select Distinct UnitNo From HouseOwner" _
+ " Where BuildingNo='" + Trim(dco_Bld.Text) + "' Order By UnitNo"
Ado_Unit.Refresh
Set dco_Unit.RowSource = Ado_Unit
dco_Unit.ListField = "UnitNo"
dco_Unit.BoundColumn = "UnitNo"
End If
End Sub
Private Sub dco_Room_Click(Area As Integer)
Refresh_Charging
End Sub
Private Sub dco_Unit_Click(Area As Integer)
If Len(Trim(dco_Unit.Text)) > 0 And Len(Trim(dco_Bld.Text)) > 0 Then
Ado_Room.ConnectionString = Conn
Ado_Room.RecordSource = "Select Distinct RoomNo,OwnerId From HouseOwner" _
+ " Where UnitNo='" + Trim(dco_Unit.Text) + "' And BuildingNo='" _
+ Trim(dco_Bld.Text) + "' Order By RoomNo"
Ado_Room.Refresh
Set dco_Room.RowSource = Ado_Room
dco_Room.ListField = "RoomNo"
dco_Room.BoundColumn = "OwnerId"
End If
End Sub
Private Sub Form_Load()
'装入楼房号和房屋信息
Ado_Bld.ConnectionString = Conn
Ado_Bld.RecordSource = "Select * From Building Order By BuildingNo"
Ado_Bld.Refresh
Set dco_Bld.RowSource = Ado_Bld
dco_Bld.ListField = "BuildingNo"
dco_Bld.BoundColumn = "BuildingNo"
Refresh_Charging
End Sub
Private Sub Refresh_Charging()
Dim TmpSource As String
Dim TmpSch As String
Dim TmpAll As String
If Len(Trim(dco_Bld.Text)) > 0 Then
TmpSch = " And o.BuildingNo='" + Trim(dco_Bld.Text) + "'"
If Len(Trim(dco_Unit.Text)) > 0 Then
TmpSch = TmpSch + " And o.UnitNo='" + Trim(dco_Unit.Text) + "'"
If Len(Trim(dco_Room.Text)) > 0 Then
TmpSch = TmpSch + " And c.OwnerId=" + Trim(dco_Room.BoundText())
End If
End If
TmpAll = " "
Else
TmpAll = " Where 1=1"
End If
TmpSource = "SELECT i.ItemName As 收费项目,i.UnitPrice As 单价,i.PayCycle AS 收费周期," _
+ "IIf(i.ItemType=0,'按建筑面积',IIf(i.ItemType=1,'按抄表刻度','按总费用')) As 收费类型," _
+ "IIF(c.Amount1 Is NULL,0,c.Amount1) As 收费金额,c.Receiver As 收费人,c.PayDate As 收费日期" _
+ " FROM ChargeItem i Left Join (Select c.* From Charging c,HouseOwner o Where c.OwnerId=o.OwnerId" + TmpSch _
+ ") c On i.ItemId=c.ItemId " + TmpAll _
+ " ORDER BY i.ItemId,c.PayDate DESC"
Adodc1.ConnectionString = Conn
Adodc1.RecordSource = TmpSource
' MsgBox TmpSource
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Columns(0).Width = 1200
DataGrid1.Columns(1).Width = 1000
DataGrid1.Columns(2).Width = 1000
DataGrid1.Columns(3).Width = 1200
DataGrid1.Columns(4).Width = 1200
DataGrid1.Columns(5).Width = 1000
DataGrid1.Columns(6).Width = 1000
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -