📄 frmowneredit.frm
字号:
VERSION 5.00
Begin VB.Form FrmOwnerEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑小区住户信息"
ClientHeight = 3930
ClientLeft = 45
ClientTop = 345
ClientWidth = 5430
Icon = "FrmOwnerEdit.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3930
ScaleWidth = 5430
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame2
Height = 1935
Left = 240
TabIndex = 15
Top = 1200
Width = 4935
Begin VB.TextBox txtMoveout
Height = 270
Left = 3720
MaxLength = 10
TabIndex = 3
Top = 637
Width = 1095
End
Begin VB.TextBox txtMovein
Height = 270
Left = 1200
MaxLength = 10
TabIndex = 2
Top = 637
Width = 1095
End
Begin VB.TextBox txtTel
Height = 270
Left = 3720
MaxLength = 20
TabIndex = 1
Top = 240
Width = 1095
End
Begin VB.TextBox txtName
Height = 270
Left = 1200
MaxLength = 20
TabIndex = 0
Top = 240
Width = 1095
End
Begin VB.TextBox txtDescribe
Height = 735
Left = 1200
MaxLength = 100
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 4
Top = 1080
Width = 3615
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "迁出日期"
Height = 180
Left = 2760
TabIndex = 20
Top = 675
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "入住日期"
Height = 180
Left = 240
TabIndex = 19
Top = 675
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "住户电话"
Height = 180
Left = 2760
TabIndex = 18
Top = 285
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "住户姓名"
Height = 180
Left = 240
TabIndex = 17
Top = 285
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备注信息"
Height = 180
Left = 240
TabIndex = 16
Top = 1080
Width = 720
End
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 3145
MouseIcon = "FrmOwnerEdit.frx":0CCA
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 6
Top = 3360
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Height = 400
Left = 985
MouseIcon = "FrmOwnerEdit.frx":0FD4
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 5
Top = 3360
Width = 1300
End
Begin VB.Frame Frame1
Height = 975
Left = 240
TabIndex = 7
Top = 120
Width = 4935
Begin VB.CommandButton Cmd_RoomSel
Caption = "选择房间"
Height = 285
Left = 3720
MouseIcon = "FrmOwnerEdit.frx":12DE
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 14
Top = 240
Width = 1065
End
Begin VB.TextBox txtBuilding
Enabled = 0 'False
Height = 270
Left = 1200
MaxLength = 20
TabIndex = 13
Top = 195
Width = 1095
End
Begin VB.TextBox txtUnit
Enabled = 0 'False
Height = 270
Left = 1200
MaxLength = 20
TabIndex = 9
Top = 605
Width = 1095
End
Begin VB.TextBox txtRoom
Enabled = 0 'False
Height = 270
Left = 3720
MaxLength = 20
TabIndex = 8
Top = 605
Width = 1095
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "楼房单元"
Height = 180
Left = 240
TabIndex = 12
Top = 650
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "楼房编号"
Height = 180
Left = 240
TabIndex = 11
Top = 240
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "房间号码"
Height = 180
Left = 2760
TabIndex = 10
Top = 650
Width = 720
End
End
End
Attribute VB_Name = "FrmOwnerEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As Long
Private Sub Cmd_OK_Click()
'检查用户录入数据的有效性
If CurHouse.HouseId <= 0 Then
MsgBox "请选择住户居住的房屋"
Exit Sub
End If
If Trim(txtName.Text) = "" Then
MsgBox "请输入住户姓名"
txtName.SetFocus
Check = False
Exit Sub
End If
'把用户输入的数据赋值到MyOwner对象中
With MyOwner
.HouseId = CurHouse.HouseId
.OwnerName = MakeStr(txtName)
.Tel = MakeStr(txtTel)
.MoveinDate = MakeStr(txtMovein)
.MoveoutDate = MakeStr(txtMoveout)
.Memo = MakeStr(txtDescribe)
'根据变量Modify的值,决定是插入数据还是修改数据
If Modify = False Then
.Insert
Else
.Update (OriId)
End If
End With
'关闭窗体
Unload Me
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_RoomSel_Click()
'启动选择房间窗体
FrmHouseSel.Show 1
'把当前房屋所在楼房的信息读取到MyBuilding对象中
MyBuilding.GetInfo (CurHouse.BuildingId)
'显示用户选择的房屋信息
txtBuilding = MyBuilding.BuildingNo
txtUnit = CurHouse.HouseUnit
txtRoom = CurHouse.RoomNo
End Sub
Private Sub Form_Load()
'读取当前选择房屋的楼房信息
MyBuilding.GetInfo (CurHouse.BuildingId)
'显示楼房编号
txtBuilding = MyBuilding.BuildingNo
'显示所在单元
txtUnit = CurHouse.HouseUnit
'显示房间号
txtRoom = CurHouse.RoomNo
End Sub
Private Sub txtDescribe_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtMovein_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtMoveout_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtName_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtTel_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -