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

📄 renyuanmodify.frm

📁 一个医药进存销程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form renyuanModify 
   Caption         =   "人员管理"
   ClientHeight    =   3420
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7965
   LinkTopic       =   "Form1"
   ScaleHeight     =   3420
   ScaleWidth      =   7965
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "退 出"
      Height          =   615
      Left            =   6960
      TabIndex        =   18
      Top             =   2520
      Width           =   855
   End
   Begin VB.CommandButton Command3 
      Caption         =   "保 存"
      Height          =   495
      Left            =   6960
      TabIndex        =   17
      Top             =   1560
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "删 除"
      Height          =   495
      Left            =   6960
      TabIndex        =   16
      Top             =   840
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修 改"
      Height          =   495
      Left            =   6960
      TabIndex        =   15
      Top             =   120
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Height          =   3375
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6735
      Begin VB.CheckBox Check1 
         Caption         =   "管理员"
         Height          =   495
         Left            =   5040
         TabIndex        =   19
         Top             =   2160
         Width           =   1335
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   4560
         TabIndex        =   7
         Top             =   1440
         Width           =   1935
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   1080
         TabIndex        =   6
         Top             =   840
         Width           =   2415
      End
      Begin VB.TextBox Text2 
         ForeColor       =   &H00000000&
         Height          =   375
         Left            =   1080
         TabIndex        =   5
         Top             =   1320
         Width           =   1815
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H00FFFFFF&
         Height          =   375
         Left            =   1080
         TabIndex        =   4
         Top             =   240
         Width           =   2415
      End
      Begin VB.TextBox Text5 
         Height          =   1095
         Left            =   1080
         MultiLine       =   -1  'True
         TabIndex        =   3
         Top             =   2040
         Width           =   3615
      End
      Begin VB.TextBox Text6 
         Height          =   375
         Left            =   4560
         TabIndex        =   2
         Top             =   240
         Width           =   1935
      End
      Begin VB.TextBox Text7 
         Height          =   375
         Left            =   4560
         TabIndex        =   1
         Top             =   840
         Width           =   1935
      End
      Begin VB.Label Label6 
         Caption         =   "备注:"
         Height          =   255
         Left            =   480
         TabIndex        =   14
         Top             =   2160
         Width           =   975
      End
      Begin VB.Label Label5 
         Caption         =   "员工代码:"
         Height          =   375
         Left            =   3600
         TabIndex        =   13
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "家庭住址:"
         Height          =   375
         Left            =   120
         TabIndex        =   12
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "联系电话:"
         Height          =   255
         Left            =   120
         TabIndex        =   11
         Top             =   1440
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "底薪:"
         Height          =   255
         Left            =   3840
         TabIndex        =   10
         Top             =   1560
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "人员姓名:"
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label7 
         Caption         =   "登录密码:"
         Height          =   255
         Left            =   3600
         TabIndex        =   8
         Top             =   960
         Width           =   975
      End
   End
End
Attribute VB_Name = "renyuanModify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Trecordset3 As New ADODB.Recordset
Sub Bai()
    Text1.Enabled = True
    Text2.Enabled = True
    Text3.Enabled = True
    Text4.Enabled = True
    Text5.Enabled = True
    Text6.Enabled = True
    Text7.Enabled = True

    Command3.Enabled = True
    Text1.BackColor = &HFFFFFF
    Text2.BackColor = &HFFFFFF
    Text3.BackColor = &HFFFFFF
    Text4.BackColor = &HFFFFFF
    Text5.BackColor = &HFFFFFF
    Text6.BackColor = &HFFFFFF
    Text7.BackColor = &HFFFFFF

End Sub
Sub Hei()
    Text1.Enabled = False
    Text2.Enabled = False
    Text3.Enabled = False
    Text4.Enabled = False
    Text5.Enabled = False
    Text6.Enabled = False
    Text7.Enabled = False

    Command3.Enabled = False
    Text1.BackColor = &H80000004
    Text2.BackColor = &H80000004
    Text3.BackColor = &H80000004
    Text4.BackColor = &H80000004
    Text5.BackColor = &H80000004
    Text6.BackColor = &H80000004
    Text7.BackColor = &H80000004

End Sub
Sub Gridflex()
    If Trecordset3.State = 1 Then Trecordset3.Close
    With Trecordset3
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from yuangong where id= val('" & renyuanID & "')  order by id desc"
         .Open
    End With

       Text6.Text = Trecordset3.Fields("haoma")
       Text1.Text = Trecordset3.Fields("name")
       Text7.Text = Trecordset3.Fields("password")
       Text2.Text = Trecordset3.Fields("tel")
       Text3.Text = Trecordset3.Fields("dizhi")
       Text4.Text = Trecordset3.Fields("gongzi")
       Text5.Text = Trecordset3.Fields("beizhu")
       If Trecordset3.Fields("guanliyuan") = 1 Then
          Check1.Value = 1
       Else
          Check1.Value = 0
       End If
'    Trecordset3.Close
'    Set Trecordset3 = Nothing
    
End Sub

Private Sub Command1_Click()
    Bai
    Command1.Enabled = False
    Command3.Enabled = True
    Command2.Enabled = False
    Tag = "2"
End Sub

Private Sub Command2_Click()
    Command3.Enabled = True
    Command1.Enabled = False
    Command2.Enabled = False
    Tag = "1"
End Sub

Private Sub Command3_Click()
If Tag = "1" Then
    If MsgBox("您确定删除本条记录吗?", vbYesNo + vbInformation, "提示") = vbYes Then
       Trecordset3.Delete
       Trecordset3.Requery
       Trecordset3.Close
      'DataToScreen
     ' If SGWConnection.State = adStateOpen Then Closconn
       MsgBox "记录已删除!", vbOKOnly + vbInformation, "提示"
       Unload renyuanModify

      ' Unload Me
    End If
ElseIf Tag = "2" Then
    Trecordset3.Fields("name") = Trim(Text1.Text)
    Trecordset3.Fields("tel") = Trim(Text2.Text)
    Trecordset3.Fields("dizhi") = Trim(Text3.Text)
    Trecordset3.Fields("gongzi") = Trim(Text4.Text)
    Trecordset3.Fields("beizhu") = Trim(Text5.Text)
    Trecordset3.Fields("haoma") = Trim(Text6.Text)
    Trecordset3.Fields("password") = Trim(Text7.Text)
    If Check1.Value = 1 Then
        Trecordset3.Fields("guanliyuan") = 1
    Else
        Trecordset3.Fields("guanliyuan") = 0
    End If
       Trecordset3.Update
       Trecordset3.Requery
       Trecordset3.Close
End If
    Hei
    Command1.Enabled = True
    Command2.Enabled = True
    Command3.Enabled = False
End Sub

Private Sub Command4_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    'set the window in the middle
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
    Hei
    Gridflex
End Sub

⌨️ 快捷键说明

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