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

📄 frmmodifyhouse.frm

📁 物业管理信息系统my sql +visual basic
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1092
      Left            =   120
      TabIndex        =   5
      Top             =   4320
      Width           =   8055
      Begin VB.CommandButton lastCommand 
         Caption         =   "最后一条记录"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   492
         Left            =   6120
         TabIndex        =   9
         Top             =   360
         Width           =   1692
      End
      Begin VB.CommandButton nextCommand 
         Caption         =   "下一条记录"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   492
         Left            =   4160
         TabIndex        =   8
         Top             =   360
         Width           =   1452
      End
      Begin VB.CommandButton previousCommand 
         Caption         =   "上一条记录"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   492
         Left            =   2200
         TabIndex        =   7
         Top             =   360
         Width           =   1452
      End
      Begin VB.CommandButton firstCommand 
         Caption         =   "第一条记录"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   492
         Left            =   240
         TabIndex        =   6
         Top             =   360
         Width           =   1452
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "修改房屋信息"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1092
      Left            =   120
      TabIndex        =   0
      Top             =   5640
      Width           =   8055
      Begin VB.CommandButton deleteCommand 
         Caption         =   "删除记录"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   492
         Left            =   4170
         TabIndex        =   4
         Top             =   390
         Width           =   1470
      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            =   6120
         TabIndex        =   3
         Top             =   360
         Width           =   1695
      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            =   2220
         TabIndex        =   2
         Top             =   390
         Width           =   1470
      End
      Begin VB.CommandButton editCommand 
         Caption         =   "修改记录"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   492
         Left            =   270
         TabIndex        =   1
         Top             =   390
         Width           =   1470
      End
   End
End
Attribute VB_Name = "frmModifyHouse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim tempHouse As clsHouse


Private Sub cancelCommand_Click()
 Unload Me
End Sub



Private Sub deleteCommand_Click()
tempHouse.DelRecord
End Sub

Private Sub editCommand_Click()
   tempHouse.EditRecord
    Frame2.Enabled = False
    firstCommand.Enabled = False
    previousCommand.Enabled = False
    nextCommand.Enabled = False
    lastCommand.Enabled = False
    txtHouseType.Enabled = True
    txtConstArea.Enabled = True
    TxtUseArea.Enabled = True
    txtComment.Enabled = True
    txtCurrentUser.Enabled = True
End Sub



Private Sub Form_Load()
    Set tempHouse = New clsHouse
    tempHouse.LoadRecord
    Call viewData
    txtHouseNO.Enabled = False
    txtHouseType.Enabled = False
    txtConstArea.Enabled = False
    TxtUseArea.Enabled = False
    txtCurrentUser.Enabled = False
    txtComment.Enabled = False
    txtModifyName.Enabled = False
    txtModifyDate.Enabled = False
End Sub

Public Sub viewData()
    txtHouseNO.Text = tempHouse.mrc.Fields(0)
    txtHouseType.Text = tempHouse.mrc.Fields(1)
    txtConstArea.Text = tempHouse.mrc.Fields(2)
    TxtUseArea.Text = tempHouse.mrc.Fields(3)
    txtCurrentUser.Text = tempHouse.mrc.Fields(4)
    txtComment.Text = tempHouse.mrc.Fields(5)
    txtModifyName.Text = tempHouse.mrc.Fields(6)
    txtModifyDate.Text = tempHouse.mrc.Fields(7)
End Sub


Private Sub firstCommand_Click()
   tempHouse.mrc.MoveFirst
    Call viewData
End Sub
Private Sub previousCommand_Click()
 tempHouse.mrc.MovePrevious
    If tempHouse.mrc.BOF Then
        tempHouse.mrc.MoveLast
    End If
    Call viewData
End Sub
Private Sub nextCommand_Click()
 tempHouse.mrc.MoveNext
    If tempHouse.mrc.EOF Then
        tempHouse.mrc.MoveFirst
    End If
    Call viewData
End Sub
Private Sub lastCommand_Click()
 tempHouse.mrc.MoveLast
    Call viewData
End Sub




Private Sub updateCommand_Click()
 Dim txtSQL As String
    Dim MsgText As String
    Dim mrcc As ADODB.Recordset
    If tempHouse.mcclean Then
        MsgBox "请先修改房型资料信息", vbOKOnly + vbExclamation, "警告"
        Exit Sub
    End If
    
    If Not Testtxt(txtHouseNO.Text) Then
        MsgBox "请输入房型编号!", vbOKOnly + vbExclamation, "警告"
        txtHouseNO.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(txtHouseType.Text) Then
        MsgBox "请输入房型!", vbOKOnly + vbExclamation, "警告"
        txtHouseType.SetFocus
        Exit Sub
    End If
    
    If Not IsNumeric(txtConstArea.Text) Then
        MsgBox "请输入建筑面积", vbOKOnly + vbExclamation, "警告"
        txtConstArea.SetFocus
        Exit Sub
    End If
    
    If Not IsNumeric(TxtUseArea.Text) Then
        MsgBox "请输入使用面积!", vbOKOnly + vbExclamation, "警告"
        TxtUseArea.SetFocus
        Exit Sub
    End If
        tempHouse.Update txtHouseNO.Text, txtHouseType.Text, Val(txtConstArea.Text), Val(TxtUseArea.Text), txtCurrentUser.Text, txtComment.Text
        Call viewData
        '导航按钮有效
        Frame2.Enabled = True
        firstCommand.Enabled = True
        previousCommand.Enabled = True
        nextCommand.Enabled = True
        lastCommand.Enabled = True
        '记录只读
        txtHouseNO.Enabled = False
        txtHouseType.Enabled = False
        txtConstArea.Enabled = False
        TxtUseArea.Enabled = False
        txtComment.Enabled = False
End Sub

⌨️ 快捷键说明

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