⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_fangchan_edit.frm

📁 前些年帮人写的毕业设计
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frm_fangchan_edit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "房产资料修改"
   ClientHeight    =   2910
   ClientLeft      =   4305
   ClientTop       =   2550
   ClientWidth     =   2955
   Icon            =   "Frm_fangchan_edit.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2910
   ScaleWidth      =   2955
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox Text1 
      Height          =   300
      Left            =   1080
      TabIndex        =   6
      Top             =   180
      Width           =   1695
   End
   Begin VB.TextBox Text2 
      Height          =   300
      Left            =   1080
      TabIndex        =   5
      Top             =   600
      Width           =   1695
   End
   Begin VB.TextBox Text3 
      Height          =   300
      Left            =   1080
      TabIndex        =   4
      Top             =   1020
      Width           =   1695
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   1080
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   1440
      Width           =   1695
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      Left            =   1080
      Style           =   2  'Dropdown List
      TabIndex        =   2
      Top             =   1860
      Width           =   1695
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   315
      Left            =   360
      TabIndex        =   1
      Top             =   2400
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   315
      Left            =   1620
      TabIndex        =   0
      Top             =   2400
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "房产号"
      Height          =   255
      Left            =   180
      TabIndex        =   11
      Top             =   240
      Width           =   675
   End
   Begin VB.Label Label2 
      Caption         =   "建筑面积"
      Height          =   255
      Left            =   180
      TabIndex        =   10
      Top             =   660
      Width           =   735
   End
   Begin VB.Label Label3 
      Caption         =   "使用面积"
      Height          =   255
      Left            =   180
      TabIndex        =   9
      Top             =   1080
      Width           =   915
   End
   Begin VB.Label Label4 
      Caption         =   "是否出租"
      Height          =   315
      Left            =   180
      TabIndex        =   8
      Top             =   1500
      Width           =   855
   End
   Begin VB.Label Label5 
      Caption         =   "是否出售"
      Height          =   195
      Left            =   180
      TabIndex        =   7
      Top             =   1920
      Width           =   855
   End
End
Attribute VB_Name = "Frm_fangchan_edit"
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
    Text1 = Frm_fangchan.ListView1.SelectedItem.Text
    Text2 = Frm_fangchan.ListView1.SelectedItem.SubItems(1)
    Text3 = Frm_fangchan.ListView1.SelectedItem.SubItems(2)
    Combo1 = Frm_fangchan.ListView1.SelectedItem.SubItems(3)
    Combo2 = Frm_fangchan.ListView1.SelectedItem.SubItems(4)
End Sub

Private Sub Command1_Click()
    On Error GoTo myerr
    Dim cn As ADODB.Connection
    msg = MsgBox("是否修改?", vbYesNo + vbQuestion, "提示")
    If msg = vbNo Then Exit Sub
    
    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 "update fangchan set fh='" & Trim(Text1) & "',jzmj=" & Trim(Text2) & ",symj=" & Trim(Text3) & ",cz=" & IIf(Combo1 = "是", True, False) & ",cs=" & IIf(Combo2 = "是", True, False) & " where id=" & Frm_fangchan.ListView1.SelectedItem.SubItems(5)
    Frm_fangchan.ListView1.SelectedItem.Text = Text1
    Frm_fangchan.ListView1.SelectedItem.SubItems(1) = Text2
    Frm_fangchan.ListView1.SelectedItem.SubItems(2) = Text3
    Frm_fangchan.ListView1.SelectedItem.SubItems(3) = Combo1
    Frm_fangchan.ListView1.SelectedItem.SubItems(4) = Combo2
    MsgBox "已成功保存!", vbExclamation, "提示"
    Unload Me
    Exit Sub
myerr:
    MsgBox Error, vbExclamation, "提示"
    
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -