📄 frmuseredit.frm
字号:
TabIndex = 41
Top = 5685
Width = 810
End
Begin VB.Label Label22
AutoSize = -1 'True
Caption = "备 注:"
Height = 180
Left = 120
TabIndex = 43
Top = 6000
Width = 810
End
Begin VB.Label Label21
AutoSize = -1 'True
Caption = "终止读数:"
Height = 180
Left = 2760
TabIndex = 39
Top = 5280
Width = 810
End
Begin VB.Label Label20
AutoSize = -1 'True
Caption = "上月读数:"
Height = 180
Left = 2760
TabIndex = 37
Top = 4805
Width = 810
End
Begin VB.Label Label19
AutoSize = -1 'True
Caption = "旁通管径:"
Height = 180
Left = 2760
TabIndex = 35
Top = 4335
Width = 810
End
Begin VB.Label Label18
AutoSize = -1 'True
Caption = "水表装法:"
Height = 180
Left = 2760
TabIndex = 33
Top = 3865
Width = 810
End
Begin VB.Label Label17
AutoSize = -1 'True
Caption = "表井位置:"
Height = 180
Left = 2760
TabIndex = 31
Top = 3395
Width = 810
End
Begin VB.Label Label16
AutoSize = -1 'True
Caption = "加封日期:"
Height = 180
Left = 2760
TabIndex = 29
Top = 2925
Width = 810
End
Begin VB.Label Label15
AutoSize = -1 'True
Caption = "始用日期:"
Height = 180
Left = 2760
TabIndex = 27
Top = 2455
Width = 810
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "水 表 号:"
Height = 180
Left = 2760
TabIndex = 25
Top = 1985
Width = 810
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "水表直径:"
Height = 180
Left = 120
TabIndex = 24
Top = 5640
Width = 810
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "用水人数:"
Height = 180
Left = 120
TabIndex = 22
Top = 5185
Width = 810
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "纳 税 号:"
Height = 180
Left = 120
TabIndex = 20
Top = 4730
Width = 810
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "账 号:"
Height = 180
Left = 120
TabIndex = 18
Top = 4275
Width = 810
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "开 户 行:"
Height = 180
Left = 120
TabIndex = 16
Top = 3820
Width = 810
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "用户开户:"
Height = 180
Left = 120
TabIndex = 14
Top = 3365
Width = 810
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "用水性质:"
Height = 180
Left = 120
TabIndex = 12
Top = 2910
Width = 810
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "户 型:"
Height = 180
Left = 120
TabIndex = 10
Top = 2455
Width = 810
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "电 话:"
Height = 180
Left = 120
TabIndex = 8
Top = 1985
Width = 810
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "地 址:"
Height = 180
Left = 120
TabIndex = 6
Top = 1545
Width = 810
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "户 名:"
Height = 180
Left = 120
TabIndex = 4
Top = 1090
Width = 810
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "编 号:"
Height = 180
Left = 120
TabIndex = 2
Top = 635
Width = 810
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "选择分区:"
Height = 180
Left = 120
TabIndex = 0
Top = 180
Width = 810
End
End
Attribute VB_Name = "frmUserEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdAdd_Click()
On Error GoTo AddErr
Data.Recordset.AddNew
txtFields(0).SetFocus
Exit Sub
AddErr:
MsgBox Err.Description
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With Data.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdRefresh_Click()
'只有多用户应用程序需要
On Error GoTo RefreshErr
Data.Refresh
Exit Sub
RefreshErr:
MsgBox Err.Description
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
Data.UpdateRecord
Exit Sub
UpdateErr:
MsgBox Err.Description
End Sub
Private Sub comRegion_Click()
'根据分区号选择分区
Dim RegionNumber As Integer, strSQL As String
RegionNumber = comRegion.ListIndex + 1
strSQL = "select * from 用户档案 where 分区=" & RegionNumber
Data.RecordSource = strSQL
Data.Refresh
End Sub
Private Sub Data_Reposition()
Data.Caption = "记录:" & Data.Recordset.AbsolutePosition + 1
End Sub
Private Sub Form_Load()
'给组合框添加列表项
Dim i As Integer
For i = 1 To RegionNumber
comRegion.AddItem i
Next
comFields(0).AddItem "居民01"
comFields(0).AddItem "事业02"
comFields(0).AddItem "工业03"
comFields(0).AddItem "商业04"
comFields(0).AddItem "特种05"
comFields(1).AddItem "单一"
comFields(1).AddItem "过表"
comFields(2).AddItem "普通用户"
comFields(2).AddItem "临时用户"
comFields(2).AddItem "施工用户"
'设定数据控件属性
Data.DatabaseName = App.Path & "\用户档案.mdb"
Data.RecordSource = "用户档案"
'给数据绑定控件添加字段
txtFields(0).DataField = "编号": txtFields(1).DataField = "户名"
txtFields(2).DataField = "地址": txtFields(3).DataField = "电话"
txtFields(4).DataField = "开户行": txtFields(5).DataField = "帐号"
txtFields(6).DataField = "纳税号": txtFields(7).DataField = "用水人数"
txtFields(9).DataField = "水表号"
txtFields(10).DataField = "始用日期": txtFields(11).DataField = "加封日期"
txtFields(12).DataField = "表井位置": txtFields(13).DataField = "水表装法"
txtFields(14).DataField = "旁通管径": txtFields(15).DataField = "上月读数"
txtFields(16).DataField = "终止读数": txtFields(17).DataField = "分区"
comFields(0).DataField = "户型": comFields(1).DataField = "用水性质"
comFields(2).DataField = "用户开户": comFields(3).DataField = "水表直径"
lstFields.DataField = "备注"
Data.Refresh '刷新数据控件
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -