📄 frm_sfdjgl.frm
字号:
Caption = "上月读数"
Height = 180
Index = 2
Left = -72465
TabIndex = 79
Top = 735
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "使用数量"
Height = 180
Index = 2
Left = -74745
TabIndex = 78
Top = 1620
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "本月读数"
Height = 180
Index = 2
Left = -74745
TabIndex = 77
Top = 1200
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "应收金额"
Height = 180
Index = 2
Left = -72420
TabIndex = 76
Top = 1620
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "计费起始日期"
Height = 180
Index = 2
Left = -74745
TabIndex = 75
Top = 2160
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "计费终止日期"
Height = 180
Index = 2
Left = -74745
TabIndex = 74
Top = 2595
Width = 1080
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "实收金额"
Height = 180
Index = 2
Left = -74745
TabIndex = 73
Top = 3135
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "户主姓名"
Height = 180
Index = 3
Left = -74790
TabIndex = 72
Top = 645
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "收费标准"
Height = 180
Index = 3
Left = -72450
TabIndex = 71
Top = 615
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "建筑面积"
Height = 180
Index = 3
Left = -74790
TabIndex = 70
Top = 1080
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "应收金额"
Height = 180
Index = 3
Left = -74775
TabIndex = 69
Top = 1560
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "计费起始日期"
Height = 180
Index = 3
Left = -74775
TabIndex = 68
Top = 2085
Width = 1080
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "计费终止日期"
Height = 180
Index = 3
Left = -74775
TabIndex = 67
Top = 2670
Width = 1080
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "实收金额"
Height = 180
Index = 3
Left = -74730
TabIndex = 66
Top = 3195
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "计费起始日期"
Height = 180
Index = 0
Left = 165
TabIndex = 65
Top = 2205
Width = 1080
End
End
Begin VB.Label Label14
Caption = "Label14"
DataField = "业主姓名"
DataSource = "Adodc5"
Height = 240
Left = 570
TabIndex = 10
Top = 5730
Width = 1485
End
Begin VB.Label Label13
Caption = "Label13"
DataField = "房间编号"
DataSource = "Adodc3"
Height = 270
Left = 585
TabIndex = 9
Top = 5340
Width = 855
End
Begin VB.Label Label12
Caption = "Label12"
DataField = "大楼名称"
DataSource = "Adodc2"
Height = 225
Left = 765
TabIndex = 8
Top = 5355
Width = 2325
End
Begin VB.Label Label11
Caption = "Label11"
DataField = "小区名称"
DataSource = "Adodc1"
Height = 255
Left = 1440
TabIndex = 7
Top = 5550
Width = 1170
End
End
Attribute VB_Name = "frm_sfdjgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer
Private Sub CmdSave_Click() '保存(水费)
If Text10.Text = "" Then
MsgBox "请输入本月读数", , "系统提示"
Else
Set adors = cn.Execute("insert into tab_smoney values('" & Text1(0) & "','" & Text2(0) & "','" & DTPicker3.Value & "','" & DTPicker2(0).Value & "','" & Text10 & "','" & Text3(0) & "','" & Text4(0) & "','" & Text6(0) & "','" & Text7(0) & "','" & Label13 & "') ")
MsgBox "数据保存成功", , "系统提示"
Adodc4.Refresh
Command3(0).Enabled = True '添加按钮可用
CmdSave.Enabled = False '保存按钮不可用
Command2(0).Enabled = False '取消按钮不可用
End If
End Sub
Private Sub Combo2_Click()
Adodc2.RecordSource = "select * from tab_dlinfo where 大楼编号 like '" + Combo2.Text + "%'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
txtdlmc.Text = Adodc2.Recordset.Fields("大楼名称")
End If
End Sub
Private Sub Command10_Click() '添加(采暖费)
Command10.Enabled = False '添加按钮不可用
Command11.Enabled = True '保存按钮可用
Command12.Enabled = True '取消按钮可用
Text7(3).Enabled = True
Text7(3).SetFocus
End Sub
Private Sub Command11_Click() '保存(采暖费)
If Text7(3).Text = "" Then
MsgBox "请输入实收金额", , "系统提示"
Else
Set adors = cn.Execute("insert into tab_cnmoney values('" & Text1(3) & "','" & Text2(3) & "','" & DTPicker8.Value & "','" & DTPicker9.Value & "','" & Text5 & "','" & Text6(3) & "','" & Text7(3) & "','" & Label13 & "') ")
MsgBox "数据保存成功!", , "系统提示"
Command10.Enabled = True '添加按钮可用
Command11.Enabled = False '保存按钮不可用
Command12.Enabled = False '取消按钮不可用
End If
End Sub
Private Sub Command12_Click() '取消(采暖费)
Text7(3).Text = ""
Command10.Enabled = True '添加按钮可用
Command11.Enabled = False '保存按钮不可用
Command12.Enabled = False '取消按钮不可用
End Sub
'Private Sub Command13_Click() '其他费(添加)
' Command13.Enabled = False '添加按钮不可用
' Command14.Enabled = True '保存按钮可用
' Command15.Enabled = True '取消按钮可用
' Text7(4).Enabled = True
' Text7(4).SetFocus
'End Sub
'Private Sub Command14_Click() '其他费(保存)
' If Text7(4).Text = "" Then
' MsgBox "请输入实收金额", , "系统提示"
' Else
' Set adors = cn.Execute("insert into tab_othermoney values('" & Label13 & "','" & Text1(4) & "','" & Combo1 & "','" & Text2(4) & "','" & Text21 & "','" & Text7(4) & "','" & DTPicker1.Value & "','" & DTPicker10.Value & "') ")
' MsgBox "数据保存成功!", , "系统提示"
' Command13.Enabled = True '添加按钮可用
' Command14.Enabled = False '保存按钮不可用
' Command15.Enabled = False '取消按钮不可用
' End If
'End Sub
'Private Sub Command15_Click() '取消(其他费)
' Text7(4).Text = ""
' Command13.Enabled = True '添加按钮可用
' Command14.Enabled = False '保存按钮不可用
' Command15.Enabled = False '取消按钮不可用
'End Sub
Private Sub Command2_Click(Index As Integer) '取消(水费)
Text10.Text = ""
Command3(0).Enabled = True '添加按钮可用
CmdSave.Enabled = False '保存按钮不可用
Command2(0).Enabled = False '取消按钮不可用
End Sub
Private Sub Command3_Click(Index As Integer) '添加(水费)
Command3(0).Enabled = False '添加按钮不可用
CmdSave.Enabled = True '保存按钮可用
Command2(0).Enabled = True '取消按钮可用
Text10.Enabled = True
Text10.SetFocus
End Sub
Private Sub Command4_Click() '保存(电费)
If Text11.Text = "" Then
MsgBox "请输入本月读数", , "系统提示"
Else
Set adors = cn.Execute("insert into tab_dianmoney values('" & Text1(1) & "','" & Text2(1) & "','" & DTPicker4.Value & "','" & DTPicker5.Value & "','" & Text11 & "','" & Text3(1) & "','" & Text4(1) & "','" & Text6(1) & "','" & Text7(1) & "','" & Label13 & "') ")
MsgBox "数据保存成功!", , "系统提示"
Adodc4.Refresh
Command5.Enabled = True '添加按钮可用
Command4.Enabled = False '保存按钮不可用
Command6.Enabled = False '取消按钮不可用
End If
End Sub
Private Sub Command5_Click() '添加(电费)
Command5.Enabled = False '添加按钮不可用
Command4.Enabled = True '保存按钮可用
Command6.Enabled = True '取消按钮可用
Text11.Enabled = True
Text11.SetFocus
End Sub
Private Sub Command6_Click() '取消(电费)
Text11.Text = ""
Command5.Enabled = True '添加按钮可用
Command4.Enabled = False '保存按钮不可用
Command6.Enabled = False '取消按钮不可用
End Sub
Private Sub Command7_Click() '添加(煤气费)
Command7.Enabled = False '添加按钮不可用
Command8.Enabled = True '保存按钮可用
Command9.Enabled = True '取消按钮可用
Text14.Enabled = True
Text14.SetFocus
End Sub
Private Sub Command8_Click() '保存(煤气费)
If Text14.Text = "" Then
MsgBox "请输入本月读数", , "系统提示"
Else
Set adors = cn.Execute("insert into tab_mqmoney values('" & Text1(2) & "','" & Text2(2) & "','" & DTPicker6.Value & "','" & DTPicker7.Value & "','" & Text14 & "','" & Text3(2) & "','" & Text4(2) & "','" & Text6(2) & "','" & Text7(2) & "','" & Label13 & "') ")
MsgBox "数据保存成功", , "系统提示"
Command7.Enabled = True '添加按钮可用
Command8.Enabled = False '保存按钮不可用
Command9.Enabled = False '取消按钮不可用
End If
End Sub
Private Sub Command9_Click() '取消(煤气费)
Text14.Text = ""
Command7.Enabled = True '添加按钮可用
Command8.Enabled = False '保存按钮不可用
Command9.Enabled = False '取消按钮不可用
End Sub
Private Sub DataGrid1_Click()
txtdlmc.Text = Adodc2.Recordset.Fields("大楼名称")
Adodc3.RecordSource = "select * from tab_fwinfo where 大楼名称 ='" + txtdlmc.Text + "'"
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
Txtfjbh.Text = Adodc3.Recordset.Fields("房间编号")
End If
End Sub
Private Sub DataGrid2_Click()
Txtfjbh.Text = Adodc3.Recordset.Fields("房间编号")
Adodc5.RecordSource = "select * from tab_yzinfo where 业主代号 = '" + Txtfjbh.Text + "'and 是否进住 ='已进住'"
Adodc5.Refresh
If Adodc5.Recordset.RecordCount > 0 Then
For i = 0 To 3
Text1(i).Text = Label14.Caption
Next i
'水费管理
Dim rs1 As New ADODB.Recordset
rs1.Open "select * from tab_smoney where 户主姓名= '" + Label14.Caption + "'", cn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
Text3(0).Text = rs1.Fields("本月读数")
DTPicker3.Value = rs1.Fields("计费终止日期") '设置起始日期
DTPicker2(0).Value = Date '计费终止日期为今天的日期
Text2(0).Enabled = False '收费标准
Text3(0).Enabled = False '上月读数
DTPicker3.Enabled = False '计费起始时间
Text10.Enabled = False
Else
Text3(0).Text = 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -