📄 frm_sdgl.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Frm_sdgl
Caption = "水电数据管理"
ClientHeight = 5430
ClientLeft = 60
ClientTop = 345
ClientWidth = 6810
Icon = "Frm_sdgl.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5430
ScaleWidth = 6810
WindowState = 2 'Maximized
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 570
Left = 0
TabIndex = 0
Top = 0
Width = 6810
_ExtentX = 12012
_ExtentY = 1005
ButtonWidth = 820
ButtonHeight = 953
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 6
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "刷新"
Key = "renovate"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查询"
Key = "query"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "录入"
Key = "add"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "edit"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "del"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "exit"
ImageIndex = 7
EndProperty
EndProperty
Begin MSComctlLib.ImageList ImageList1
Left = 3720
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 8
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":014A
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":02A4
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":03FE
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":0558
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":06B2
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":080C
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":0966
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_sdgl.frx":0AC0
Key = ""
EndProperty
EndProperty
End
End
Begin MSComctlLib.ListView ListView1
Height = 4815
Left = 0
TabIndex = 1
Top = 600
Width = 7095
_ExtentX = 12515
_ExtentY = 8493
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
Icons = "ImageList1"
SmallIcons = "ImageList1"
ColHdrIcons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 16
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "房号"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "业主"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 2
Text = "综合管理费"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 3
Text = "水表上月读数"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 4
Text = "水表本月读数"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 5
Text = "水费"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 6
Text = "电表上月"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 7
Text = "电表本月读数"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 8
Text = "电费"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(10) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 9
Text = "水泵公摊"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(11) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 10
Text = "水损公摊"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(12) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 11
Text = "其他公摊"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(13) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 12
Text = "应交费用"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(14) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 13
Text = "抄表员"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(15) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 14
Text = "抄表日期"
Object.Width = 1940
EndProperty
BeginProperty ColumnHeader(16) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 15
Text = "id"
Object.Width = 0
EndProperty
End
End
Attribute VB_Name = "Frm_sdgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Resize()
If Me.Height > 1000 Then ListView1.Height = Me.Height - 1000
If Me.Width > 120 Then ListView1.Width = Me.Width - 120
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "renovate"
renovate
Case "query"
Frm_sdgl_query.Show 1
Case "add"
Frm_sdgl_add.Show 1
Case "edit"
If ListView1.ListItems.Count = 0 Then Exit Sub
Frm_sdgl_edit.Show 1
Case "del"
If ListView1.ListItems.Count = 0 Then Exit Sub
del
Case "exit"
Unload Me
End Select
End Sub
Private Sub del()
On Error GoTo myerr
msg = MsgBox("是否删除?", vbYesNo + vbQuestion, "提示")
If msg = vbNo Then Exit Sub
Dim cn As ADODB.Connection
Set cn = GetCn
cn.Execute "delete from jiaofei where id=" & ListView1.SelectedItem.SubItems(15)
ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
MsgBox "成功删除!", vbExclamation, "提示"
cn.Close
Exit Sub
myerr:
MsgBox Error, vbExclamation, "提示"
End Sub
Private Sub renovate()
On Error GoTo myerr
Dim cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim lt As ListItem
ListView1.ListItems.Clear
Set cn = GetCn
' rst.Open "select b.fh,a.yzid,a.xm,a.sfrq,a.zgf,a.sbsy,a.sbby,a.dbsy,a.dbby,a.cbrq,a.cby,a.sf,a.sb,a.ss,a.qt,a.df,a.yj,a.sj,a.zn,a.sky from jiaofei a inner join fangchan b on a.fcid=b.id where a.sfrq<=#" & DTPicker1.Value & "# and a.sfrq>=#" & DTPicker2.Value & "# order by 1", cn, 0, 1
rst.Open "select c.fh,b.xm,a.zgf,a.sbsy,a.sbby,a.sf,a.dbsy,a.dbby,a.df,a.sb,a.ss,a.qt,a.yj,a.cby,a.cbrq,a.id from (jiaofei a inner join yezhu b on a.fid=b.fid) inner join fangchan c on b.fid=c.id order by 1", cn, 0, 1
If rst.BOF And rst.EOF Then Exit Sub
Do While Not rst.EOF
Set lt = ListView1.ListItems.Add(, , rst(0), 4, 4)
For i = 1 To rst.Fields.Count - 1
lt.SubItems(i) = Trim(rst(i) & "")
Next i
rst.MoveNext
Loop
rst.Close
cn.Close
Exit Sub
myerr:
Select Case Err
Case -2147217904
If rst.State = 1 Then rst.Close
rst.Open "select count(*) from jiaofei", cn, 0, 1
If rst(0) = 0 Then
Exit Sub
Else
MsgBox Error, vbExclamation, "提示"
End If
Case Else
MsgBox Error, vbExclamation, "提示"
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -