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

📄 frmmodifyemployee.frm

📁 VB+SQLSERVER做的房地产管理信息系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         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            =   6160
         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            =   3200
         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             =   4440
      Width           =   11295
      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            =   6225
         TabIndex        =   4
         Top             =   390
         Width           =   1440
      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            =   9120
         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            =   3240
         TabIndex        =   2
         Top             =   360
         Width           =   1455
      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           =   1350
      End
   End
End
Attribute VB_Name = "frmModifyEmployee"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mrc As ADODB.Recordset
Dim myBookmark As Variant
Dim mcclean As Boolean


Private Sub cancelCommand_Click()
 Unload Me
End Sub



Private Sub deleteCommand_Click()
  'myBookmark = mrc.Bookmark
   
    If MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录") = vbOK Then
            'mrc.MoveNext
           ' If mrc.EOF Then
              '  mrc.MoveFirst
               ' myBookmark = mrc.Bookmark
               '  mrc.Delete
              ' mrc.MoveLast
               
                
                'mrc.Bookmark = myBookmark
              '  Call viewData
           ' Else
               ' myBookmark = mrc.Bookmark
               mrc.Delete
                mrc.MoveFirst
                
              '  mrc.Bookmark = myBookmark
                Call viewData
          ' End If
    Else
       ' mrc.Bookmark = myBookmark
        Call viewData
    End If
End Sub

Private Sub editCommand_Click()

 mcclean = False
    Frame2.Enabled = False
    firstCommand.Enabled = False
    previousCommand.Enabled = False
    nextCommand.Enabled = False
    lastCommand.Enabled = False
   Dim i As Integer
 txtEmployeeID.Enabled = False
               txtName.Enabled = True
             txtSex.Enabled = True
               txtBirthDay.Enabled = True
               txtNation.Enabled = True
               txtMarriage.Enabled = True
               txtStatus.Enabled = True
               txtDegree.Enabled = True
                txtEnterCom.Enabled = True
                txtForm.Enabled = True
               txtDepartment.Enabled = True
                txtPosition.Enabled = True
               txtHomeTown.Enabled = True
              
                txtLivingPlace.Enabled = True
               txtID.Enabled = True
               
                txtAddress.Enabled = True
      
                txtZip.Enabled = True
               txtTel.Enabled = True
               
   

End Sub

Private Sub firstCommand_Click()
   mrc.MoveFirst
    Call viewData
End Sub

Private Sub Form_Load()

   
    
    Dim txtSQL As String
    Dim MsgText As String
    
    txtSQL = "select * from 员工信息"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    
    
    
    mrc.MoveFirst
    Call viewData

    mcclean = True
    
   txtEmployeeID.Enabled = False
               txtName.Enabled = False
             txtSex.Enabled = False
               txtBirthDay.Enabled = False
               txtNation.Enabled = False
               txtMarriage.Enabled = False
               txtStatus.Enabled = False
               txtDegree.Enabled = False
                txtEnterCom.Enabled = False
                txtForm.Enabled = False
               txtDepartment.Enabled = False
                txtPosition.Enabled = False
               txtHomeTown.Enabled = False
               
                txtLivingPlace.Enabled = False
               txtID.Enabled = False
              
                txtAddress.Enabled = False
           
                txtZip.Enabled = False
               txtTel.Enabled = False
               
End Sub

Public Sub viewData()
           txtEmployeeID.Text = mrc.Fields(0)
                  txtName.Text = mrc.Fields(1)
                  txtSex.Text = mrc.Fields(2)
                  txtBirthDay.Text = mrc.Fields(3)
                  txtNation.Text = mrc.Fields(4)
                  txtMarriage.Text = mrc.Fields(5)
                  txtStatus.Text = mrc.Fields(6)
                   txtDegree.Text = mrc.Fields(7)
                   txtEnterCom.Text = mrc.Fields(8)
                 txtForm.Text = mrc.Fields(9)
                  txtDepartment.Text = mrc.Fields(10)
                  txtPosition.Text = mrc.Fields(11)
                   txtHomeTown.Text = mrc.Fields(12)
                  
                 txtLivingPlace.Text = mrc.Fields(13)
                  txtID.Text = mrc.Fields(14)
               
                   txtAddress.Text = mrc.Fields(15)
              
                  txtZip.Text = mrc.Fields(16)
                   txtTel.Text = mrc.Fields(17)
                
               
End Sub

Private Sub lastCommand_Click()
 mrc.MoveLast
    Call viewData
End Sub

Private Sub nextCommand_Click()
 mrc.MoveNext
    If mrc.EOF Then
        mrc.MoveFirst
    End If
    Call viewData
End Sub

Private Sub previousCommand_Click()
 mrc.MovePrevious
    If mrc.BOF Then
        mrc.MoveLast
    End If
    Call viewData
End Sub



Private Sub txtBirthPlace_Change()

End Sub

Private Sub updateCommand_Click()


              '  mrcc.Fields(0) = Trim(txtEmployeeID.Text)
                ' mrcc.Fields(0) = Trim(txtEmployeeID.Text)
                mrc.Fields(1) = Trim(txtName.Text)
                mrc.Fields(2) = Trim(txtSex.Text)
                mrc.Fields(3) = Trim(txtBirthDay.Text)
                mrc.Fields(4) = Trim(txtNation.Text)
                mrc.Fields(5) = Trim(txtMarriage.Text)
                mrc.Fields(6) = Trim(txtStatus.Text)
                mrc.Fields(7) = Trim(txtDegree.Text)
                mrc.Fields(8) = Trim(txtEnterCom.Text)
                mrc.Fields(9) = Trim(txtForm.Text)
                mrc.Fields(10) = Trim(txtDepartment.Text)
                mrc.Fields(11) = Trim(txtPosition.Text)
                mrc.Fields(12) = Trim(txtHomeTown.Text)
                mrc.Fields(13) = Trim(txtLivingPlace.Text)
                mrc.Fields(14) = Trim(txtID.Text)
                mrc.Fields(15) = Trim(txtAddress.Text)
                mrc.Fields(16) = Trim(txtZip.Text)
                mrc.Fields(17) = Trim(txtTel.Text)
               
                 
                mrc.Update
                MsgBox "员工信息更新成功!", vbOKOnly + vbExclamation, "更新员工信息"
              '  mrc.Bookmark = myBookmark
                Call viewData
                Frame2.Enabled = True
                firstCommand.Enabled = True
                previousCommand.Enabled = True
                nextCommand.Enabled = True
                lastCommand.Enabled = True
                txtEmployeeID.Enabled = False
               txtName.Enabled = False
             txtSex.Enabled = False
               txtBirthDay.Enabled = False
               txtNation.Enabled = False
               txtMarriage.Enabled = False
               txtStatus.Enabled = False
               txtDegree.Enabled = False
                txtEnterCom.Enabled = False
                txtForm.Enabled = False
               txtDepartment.Enabled = False
                txtPosition.Enabled = False
               txtHomeTown.Enabled = False
               
                txtLivingPlace.Enabled = False
               txtID.Enabled = False
              
                txtAddress.Enabled = False
           
                txtZip.Enabled = False
               txtTel.Enabled = False
               

End Sub

⌨️ 快捷键说明

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