?? 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 + -