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

📄 frmeditbuildinginf.frm

📁 这是一个在某本书上获得的一个小区物业管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form EditBuildingInf 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑楼盘信息"
   ClientHeight    =   3150
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5190
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3150
   ScaleWidth      =   5190
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添加"
      Height          =   300
      Left            =   600
      TabIndex        =   8
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "保存"
      Default         =   -1  'True
      Height          =   300
      Left            =   1440
      TabIndex        =   9
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "关闭"
      Height          =   300
      Left            =   3960
      TabIndex        =   12
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "删除"
      Height          =   300
      Left            =   3120
      TabIndex        =   11
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cmdRefresh 
      Caption         =   "刷新"
      Height          =   300
      Left            =   2280
      TabIndex        =   10
      Top             =   2640
      Width           =   735
   End
   Begin VB.TextBox txtArea 
      DataField       =   "面积"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   1080
      MaxLength       =   100
      MultiLine       =   -1  'True
      TabIndex        =   7
      Top             =   1800
      Width           =   3495
   End
   Begin VB.CheckBox chkSale 
      Caption         =   "出售"
      DataField       =   "出售"
      DataSource      =   "Adodc1"
      Height          =   255
      Left            =   3960
      TabIndex        =   6
      Top             =   1380
      Width           =   735
   End
   Begin VB.CheckBox chkLend 
      Caption         =   "出租"
      DataField       =   "出租"
      DataSource      =   "Adodc1"
      Height          =   255
      Left            =   3240
      TabIndex        =   5
      Top             =   1380
      Width           =   735
   End
   Begin VB.ComboBox cmbTypeList 
      DataField       =   "户型"
      DataSource      =   "Adodc1"
      Height          =   300
      ItemData        =   "frmEditBuildingInf.frx":0000
      Left            =   1080
      List            =   "frmEditBuildingInf.frx":0010
      TabIndex        =   4
      Text            =   "cmbTypeList"
      Top             =   1350
      Width           =   2055
   End
   Begin VB.TextBox txtPropertyNumber 
      DataField       =   "产权号"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   1080
      MaxLength       =   50
      TabIndex        =   3
      Top             =   975
      Width           =   3495
   End
   Begin VB.TextBox txtLandNumber 
      DataField       =   "土地号"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   1080
      MaxLength       =   50
      TabIndex        =   2
      Top             =   585
      Width           =   3495
   End
   Begin VB.TextBox txtHouseHolder 
      DataField       =   "户主"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   3240
      MaxLength       =   15
      TabIndex        =   1
      Top             =   195
      Width           =   1335
   End
   Begin VB.TextBox txtDoorNumber 
      DataField       =   "门牌号"
      DataSource      =   "Adodc1"
      Height          =   270
      Left            =   1080
      MaxLength       =   9
      TabIndex        =   0
      Top             =   195
      Width           =   1335
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   600
      Top             =   2160
      Width           =   4095
      _ExtentX        =   7223
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=物管数据DSN"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "物管数据DSN"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "楼盘数据"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "面  积"
      Height          =   180
      Left            =   480
      TabIndex        =   18
      Top             =   1800
      Width           =   540
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "土地号"
      Height          =   180
      Left            =   480
      TabIndex        =   17
      Top             =   630
      Width           =   540
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "产权号"
      Height          =   180
      Left            =   480
      TabIndex        =   16
      Top             =   1020
      Width           =   540
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "户  型"
      Height          =   180
      Left            =   480
      TabIndex        =   15
      Top             =   1410
      Width           =   540
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "户  主"
      Height          =   180
      Left            =   2640
      TabIndex        =   14
      Top             =   240
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "门牌号"
      Height          =   180
      Left            =   480
      TabIndex        =   13
      Top             =   240
      Width           =   540
   End
End
Attribute VB_Name = "EditBuildingInf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Adodc1_MoveComplete(ByVal adReason As EventReasonEnum, _
        ByVal pError As Error, adStatus As EventStatusEnum, ByVal pRecordset As Recordset)
    With Adodc1.Recordset
        If .AbsolutePosition > 0 Then
            Adodc1.Caption = "当前记录:" & .AbsolutePosition & "/" & .RecordCount
        Else
            Adodc1.Caption = "当前无楼盘数据,可选择添加"
        End If
    End With
End Sub

Private Sub Adodc1_WillChangeRecord(ByVal adReason As EventReasonEnum, _
        ByVal cRecords As Long, adStatus As EventStatusEnum, ByVal pRecordset As Recordset)
        If Trim(txtDoorNumber) = "" Then
            MsgBox "门牌号不能为空!", vbCritical, "编辑楼盘数据"
            txtDoorNumber = "": txtDoorNumber.SetFocus
        ElseIf Trim(txtHouseHolder) = "" Then
            MsgBox "户主不能为空!", vbCritical, "编辑楼盘数据"
            txtHouseHolder = "": txtHouseHolder.SetFocus
        ElseIf Trim(cmbTypeList) = "" Then
            MsgBox "户型不能为空!", vbCritical, "编辑楼盘数据"
            cmbTypeList = "": cmbTypeList.SetFocus
        ElseIf Trim(txtArea) = "" Then
            MsgBox "面积不能为空!", vbCritical, "编辑楼盘数据"
            txtArea = "": txtArea.SetFocus
        End If
End Sub

Private Sub cmdAdd_Click()
    cmdAdd.Enabled = False: cmdDelete.Enabled = False: Adodc1.Enabled = False
    Adodc1.Recordset.AddNew     '添加新记录
    cmbTypeList.ListIndex = 0
    
End Sub

Private Sub cmdDelete_Click()
    With Adodc1.Recordset
        If Not .EOF Then
            If MsgBox("将删除" & Trim(txtDoorNumber) & "的数据,是否继续?", _
               vbCritical + vbYesNo, "编辑楼盘数据") = vbYes Then
                .Delete
                .MoveNext
                If .EOF And .RecordCount > 0 Then .MoveLast
            End If
        End If
    End With
End Sub

Private Sub cmdRefresh_Click()
    Adodc1.Refresh
    cmdAdd.Enabled = True: cmdDelete.Enabled = True: Adodc1.Enabled = True
End Sub

Private Sub cmdSave_Click()
    If Trim(txtDoorNumber) = "" Then
        MsgBox "门牌号不能为空!", vbCritical, "编辑楼盘数据"
        txtDoorNumber = "": txtDoorNumber.SetFocus
    ElseIf Trim(txtHouseHolder) = "" Then
        MsgBox "户主不能为空!", vbCritical, "编辑楼盘数据"
        txtHouseHolder = "": txtHouseHolder.SetFocus
    ElseIf Trim(cmbTypeList) = "" Then
        MsgBox "户型不能为空!", vbCritical, "编辑楼盘数据"
        cmbTypeList = "": cmbTypeList.SetFocus
    ElseIf Trim(txtArea) = "" Then
        MsgBox "面积不能为空!", vbCritical, "编辑楼盘数据"
        txtArea = "": txtArea.SetFocus
    Else
        Adodc1.Recordset.Update
        MsgBox "楼盘数据保存成功!", vbInformation, "编辑楼盘数据"
        cmdAdd.Enabled = True: cmdDelete.Enabled = True: Adodc1.Enabled = True
    End If
End Sub

Private Sub Form_Load()
    cmdRefresh.Value = True     '执行一此刷新操作
End Sub
Private Sub cmdExit_Click()
    Unload Me               '关闭添加楼盘数据窗体
End Sub


⌨️ 快捷键说明

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