📄 frm_fangchan_add.frm
字号:
VERSION 5.00
Begin VB.Form Frm_fangchan_add
BorderStyle = 1 'Fixed Single
Caption = "房产信息添加"
ClientHeight = 2910
ClientLeft = 4710
ClientTop = 2865
ClientWidth = 2910
Icon = "Frm_fangchan_add.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2910
ScaleWidth = 2910
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消"
Height = 315
Left = 1620
TabIndex = 11
Top = 2400
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 315
Left = 360
TabIndex = 10
Top = 2400
Width = 855
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1080
Style = 2 'Dropdown List
TabIndex = 9
Top = 1860
Width = 1695
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
Style = 2 'Dropdown List
TabIndex = 7
Top = 1440
Width = 1695
End
Begin VB.TextBox Text3
Height = 300
Left = 1080
TabIndex = 5
Top = 1020
Width = 1695
End
Begin VB.TextBox Text2
Height = 300
Left = 1080
TabIndex = 3
Top = 600
Width = 1695
End
Begin VB.TextBox Text1
Height = 300
Left = 1080
TabIndex = 1
Top = 180
Width = 1695
End
Begin VB.Label Label5
Caption = "是否出售"
Height = 195
Left = 180
TabIndex = 8
Top = 1920
Width = 855
End
Begin VB.Label Label4
Caption = "是否出租"
Height = 315
Left = 180
TabIndex = 6
Top = 1500
Width = 855
End
Begin VB.Label Label3
Caption = "使用面积"
Height = 255
Left = 180
TabIndex = 4
Top = 1080
Width = 915
End
Begin VB.Label Label2
Caption = "建筑面积"
Height = 255
Left = 180
TabIndex = 2
Top = 660
Width = 735
End
Begin VB.Label Label1
Caption = "房产号"
Height = 255
Left = 180
TabIndex = 0
Top = 240
Width = 675
End
End
Attribute VB_Name = "Frm_fangchan_add"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Combo1.AddItem "是"
Combo1.AddItem "否"
Combo2.AddItem "是"
Combo2.AddItem "否"
Combo1.ListIndex = 0
Combo2.ListIndex = 0
End Sub
Private Sub Command1_Click()
On Error GoTo myerr
Dim cn As ADODB.Connection
If Trim(Text1) = "" Then
MsgBox "房号不能为空!", vbExclamation, "提示"
Text1.SetFocus
Exit Sub
End If
If Not IsNumeric(Text2) Then
MsgBox "建筑面积不是有效的数字!", vbExclamation, "提示"
Text2.SetFocus
Exit Sub
End If
If Not IsNumeric(Text3) Then
MsgBox "使用面积不是有效的数字!", vbExclamation, "提示"
Text3.SetFocus
Exit Sub
End If
If Len(Text1) > 50 Then
MsgBox "房号超长!", vbExclamation, "提示"
Text1.SetFocus
Exit Sub
End If
Set cn = GetCn
cn.Execute "insert into fangchan (fh,jzmj,symj,cz,cs) values ('" & Text1 & "','" & Text2 & "','" & Text3 & "'," & IIf(Combo1 = "是", True, False) & "," & IIf(Combo2 = "是", True, False) & ")"
MsgBox "已成功保存!", vbExclamation, "提示"
Unload Me
Exit Sub
myerr:
MsgBox Error, vbExclamation, "提示"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -