|
龙藏于渊 发表于 2012-12-28 22:58
密码都是123
我写的让基础信息表 隐藏起来的代码 没有报错 但是为什么没有作用呢
把Workbook_Open的代码移动到登陆按钮中:- Private Sub CommandButton1_Click()
- Dim soundName As String
- Dim sh As Worksheet
- If ComboBox1.Text = "" Or TextBox1.Text = "" Then
- If ComboBox1 = "" Then
- MsgBox "用户名不能为空!", 48, "〖出入库系统〗-提示"
- ComboBox1.SetFocus
- Exit Sub
- ElseIf TextBox1 = "" Then
- MsgBox "密码不能为空!", 48, "〖出入库系统〗-提示"
- TextBox1.SetFocus
- Exit Sub
- End If
- Else
- ARR = Sheets("基础信息").Range("M2:N" & Sheets("基础信息").Range("M65536").End(3).Row)
- For I = 1 To UBound(ARR)
- If ARR(I, 1) = ComboBox1 And ARR(I, 2) = TextBox1.Text Then
- MsgBox ComboBox1.Text & "您好!欢迎您使用本系统!", 64, "〖出入库系统〗-欢迎词"
- Application.Visible = True
- Sheets("单据录入").Range("J15") = ComboBox1.Text
- If ComboBox1 <> "来宾" Then
- For Each sh In Sheets
- sh.Visible = xlSheetVisible
- Next
- Else
- For Each sh In Sheets
- If sh.Name <> "基础信息" Then sh.Visible = xlSheetVisible
- Next
- End If
- Unload Me
- Exit Sub
- End If
- Next
-
- End If
- MsgBox "登录密码错误,请重新输入!", 48, "〖出入库系统〗-提示"
- TextBox1.Text = ""
- TextBox1.SetFocus
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|