📄 frmaddhouse.frm
字号:
VERSION 5.00
Begin VB.Form frmAddHouse
BorderStyle = 1 'Fixed Single
Caption = "添加房屋信息"
ClientHeight = 3375
ClientLeft = 45
ClientTop = 330
ClientWidth = 7530
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3375
ScaleWidth = 7530
Begin VB.TextBox txtFields
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 6
Left = 1320
TabIndex = 14
Top = 2040
Width = 5895
End
Begin VB.TextBox txtFields
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 5
Left = 5160
TabIndex = 12
Top = 1480
Width = 2055
End
Begin VB.TextBox txtFields
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 4
Left = 1320
TabIndex = 10
Top = 1480
Width = 2055
End
Begin VB.TextBox txtFields
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 3
Left = 5160
TabIndex = 8
Top = 920
Width = 2055
End
Begin VB.TextBox txtFields
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 2
Left = 1320
TabIndex = 6
Top = 920
Width = 2055
End
Begin VB.TextBox txtFields
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 1
Left = 5160
TabIndex = 4
Top = 360
Width = 2055
End
Begin VB.CommandButton cancelCommand
Caption = "关闭退出"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 4440
TabIndex = 3
Top = 2640
Width = 1215
End
Begin VB.CommandButton updateCommand
Caption = "保存记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 2040
TabIndex = 2
Top = 2640
Width = 1095
End
Begin VB.TextBox txtFields
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Index = 0
Left = 1320
TabIndex = 0
Top = 360
Width = 2055
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "备注:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Index = 6
Left = 120
TabIndex = 15
Top = 2160
Width = 555
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "销售面积:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Index = 5
Left = 3840
TabIndex = 13
Top = 1560
Width = 915
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "房层高度:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Index = 4
Left = 120
TabIndex = 11
Top = 1600
Width = 915
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "阳台面积:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Index = 3
Left = 3840
TabIndex = 9
Top = 1020
Width = 915
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "使用面积:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Index = 2
Left = 120
TabIndex = 7
Top = 1040
Width = 915
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "建筑面积:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Index = 1
Left = 3810
TabIndex = 5
Top = 480
Width = 915
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "房型名称:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Index = 0
Left = 120
TabIndex = 1
Top = 480
Width = 915
End
End
Attribute VB_Name = "frmAddHouse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cancelCommand_Click()
Unload Me
End Sub
Private Sub txtfields_LostFocus(Index As Integer)
Dim pTitle As String
pTitle = "信息框"
If Not IsNumeric(txtfields(1).Text) And (txtfields(1).Text <> "") Then
MsgBox "请在“建筑面积”中输入数字", vbExclamation + vbOKOnly, pTitle
txtfields(1).SetFocus
txtfields(1).SelLength = Len(txtfields(1))
txtfields(1).SelStart = 0
End If
If Not IsNumeric(txtfields(2).Text) And (txtfields(2).Text <> "") Then
MsgBox "请在“使用面积”中输入数字", vbExclamation + vbOKOnly, pTitle
txtfields(2).SetFocus
txtfields(2).SelLength = Len(txtfields(2))
txtfields(2).SelStart = 0
End If
If Not IsNumeric(txtfields(3).Text) And (txtfields(3).Text <> "") Then
MsgBox "请在“阳台面积”中输入数字", vbExclamation + vbOKOnly, pTitle
txtfields(3).SetFocus
txtfields(3).SelLength = Len(txtfields(3))
txtfields(3).SelStart = 0
End If
If Not IsNumeric(txtfields(4).Text) And (txtfields(4).Text <> "") Then
MsgBox "请在“房层高度”中输入数字", vbExclamation + vbOKOnly, pTitle
txtfields(4).SetFocus
txtfields(4).SelLength = Len(txtfields(5))
txtfields(4).SelStart = 0
End If
If Not IsNumeric(txtfields(5).Text) And (txtfields(5).Text <> "") Then
MsgBox "请在“销售面积”中输入数字", vbExclamation + vbOKOnly, pTitle
txtfields(5).SetFocus
txtfields(5).SelLength = Len(txtfields(6))
txtfields(5).SelStart = 0
End If
End Sub
Private Sub updateCommand_Click()
Dim txtSQL As String
Dim MsgText As String
Dim mrcc As ADODB.Recordset
If Not Testtxt(txtfields(0).Text) Then
MsgBox "请输入房型名称!", vbOKOnly + vbExclamation, "警告"
txtfields(0).SetFocus
Exit Sub
End If
txtSQL = "select * from 房型信息 where 房型名称 = '" & Trim(txtfields(0).Text) & "'"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
If mrcc.EOF = False Then
MsgBox "房型名称重复,请重新输入!", vbOKOnly + vbExclamation, "警告"
mrcc.Close
txtfields(0).SetFocus
Else
mrcc.AddNew
mrcc.Fields(0) = Trim(txtfields(0).Text)
mrcc.Fields(1) = Val(txtfields(1).Text)
mrcc.Fields(2) = Val(txtfields(2).Text)
mrcc.Fields(3) = Val(txtfields(3).Text)
mrcc.Fields(4) = Val(txtfields(4).Text)
mrcc.Fields(5) = Val(txtfields(5).Text)
mrcc.Fields(6) = Val(txtfields(6).Text)
mrcc.Update
MsgBox "房型信息添加成功!", vbOKOnly + vbExclamation, "添加房型信息"
mrcc.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -