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

📄 frmpeopset.frm

📁 用于电子行业打印复杂报表格式和不干胶标签
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Index           =   4
      Left            =   4957
      TabIndex        =   5
      Top             =   600
      Width           =   1185
   End
   Begin VB.TextBox frmTxt 
      DataField       =   "部门"
      DataSource      =   "Adodc1"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Index           =   2
      Left            =   4972
      TabIndex        =   2
      Top             =   180
      Width           =   1185
   End
   Begin VB.TextBox frmTxt 
      DataField       =   "用户名称"
      DataSource      =   "Adodc1"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Index           =   1
      Left            =   2932
      TabIndex        =   1
      Top             =   180
      Width           =   1185
   End
   Begin VB.TextBox frmTxt 
      DataField       =   "用户帐号"
      DataSource      =   "Adodc1"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Index           =   0
      Left            =   892
      TabIndex        =   0
      Top             =   180
      Width           =   1185
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   2340
      TabIndex        =   22
      Top             =   660
      Width           =   630
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00808000&
      BorderWidth     =   2
      X1              =   240
      X2              =   6140
      Y1              =   1050
      Y2              =   1050
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "指定测试人:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   3765
      TabIndex        =   20
      Top             =   660
      Width           =   1260
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "角色:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   300
      TabIndex        =   19
      Top             =   660
      Width           =   630
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "部门:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   4395
      TabIndex        =   18
      Top             =   240
      Width           =   630
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "全称:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   2355
      TabIndex        =   17
      Top             =   240
      Width           =   630
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "姓名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   315
      TabIndex        =   16
      Top             =   240
      Width           =   630
   End
End
Attribute VB_Name = "frmPeopSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdadd_Click()
  On Error Resume Next
  
  If cmdadd.Caption = "添加" Then
    Adodc1.Recordset.AddNew
    Call SetCtlStatus(frmPeopSet, True)
    frmtxt(0).SetFocus
    '设置按钮状态
    For i = 0 To 3
      CmdLiulan(i).Enabled = False
    Next
    cmddel.Enabled = False
    cmdedit.Enabled = False
    cmdsearch.Enabled = False
    cmdclose.Enabled = False
    cmdadd.Caption = "保存"
  Else
    If Trim(frmtxt(3).Text) = "" Then
      MsgBox "密码不能为空!", 0 + 16, "提示窗"
      Exit Sub
    End If
    Adodc1.Recordset("用户密码") = Encrypt(Trim(frmtxt(3).Text))
    Adodc1.Recordset.Update
    Adodc1.Recordset.Requery    '该语句非常重要,否则 Update 将出错
    For i = 0 To 3
      CmdLiulan(i).Enabled = True
    Next
    cmddel.Enabled = True
    cmdedit.Enabled = True
    cmdsearch.Enabled = True
    cmdclose.Enabled = True
    Call SetCtlStatus(frmPeopSet, False)
    cmdadd.Caption = "添加"
  End If
End Sub

Private Sub CmdClose_Click()
  Unload Me
End Sub

Private Sub cmddel_Click()
  On Error Resume Next
  
  If Adodc1.Recordset.RecordCount > 0 Then
    If MsgBox("确定要删除该记录吗?", 4 + 32, "删除确认") = 6 Then
      Adodc1.Recordset.Delete
      Adodc1.Recordset.MoveNext
      If Adodc1.Recordset.RecordCount > 0 Then Adodc1.Recordset.MoveLast
    End If
  Else
    MsgBox "记录已为空!", 0 + 64, "信息窗"
  End If
End Sub

Private Sub cmdEdit_Click()
  On Error Resume Next
  
  If cmdedit.Caption = "修改" Then
    varMark = Adodc1.Recordset.Bookmark    '记下当前记录的位置
    Call SetCtlStatus(frmPeopSet, True)
    '设置按钮状态
    For i = 0 To 3
      CmdLiulan(i).Enabled = False
    Next
    cmddel.Enabled = False
    cmdadd.Enabled = False
    cmdsearch.Enabled = False
    cmdclose.Enabled = False
    cmdedit.Caption = "保存"
  Else
    Adodc1.Recordset.Update
    Adodc1.Recordset.Requery
    Adodc1.Recordset.Bookmark = varMark
    For i = 0 To 3
      CmdLiulan(i).Enabled = True
    Next
    cmddel.Enabled = True
    cmdadd.Enabled = True
    cmdsearch.Enabled = True
    cmdclose.Enabled = True
    Call SetCtlStatus(frmPeopSet, False)
    cmdedit.Caption = "修改"
  End If
End Sub

Private Sub cmdLiulan_Click(Index As Integer)
  If Adodc1.Recordset.RecordCount > 0 Then
    Select Case Index
      Case 0
        Adodc1.Recordset.MoveFirst
      Case 1
        Adodc1.Recordset.MovePrevious
        If Adodc1.Recordset.BOF = True Then Adodc1.Recordset.MoveFirst
      Case 2
        Adodc1.Recordset.MoveNext
        If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveLast
      Case 3
        Adodc1.Recordset.MoveLast
    End Select
  End If
End Sub

Private Sub cmdSearch_Click()
  tabname = "用户权限"
  If cmdsearch.Caption = "查找" Then
    frmSearch.Show vbModal
    If strQuery <> "" Then
      Adodc1.RecordSource = strQuery
      Adodc1.Refresh
      cmdsearch.Caption = "重置"
    End If
  Else
    strQuery = "Select * From " & tabname
    Adodc1.RecordSource = strQuery
    Adodc1.Refresh
    cmdsearch.Caption = "查找"
  End If
End Sub

Private Sub Form_Load()
  Adodc1.ConnectionString = strConn
  Adodc1.RecordSource = "Select * From 用户权限"
  Adodc1.Refresh
  frmCmb.Clear
  frmCmb.AddItem "普通用户"
  frmCmb.AddItem "系统管理员"
  Call SetCtlStatus(frmPeopSet, False)
End Sub

Private Sub frmCmb_LostFocus()
  If Trim(frmCmb.Text) = "批准者" Then
    frmtxt(4).Enabled = True
  Else
    frmtxt(4).Enabled = False
  End If
End Sub

⌨️ 快捷键说明

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