|
-
Mar 13th, 2002, 07:38 AM
#1
Thread Starter
New Member
Excel Form Password Entry
hey guys, my first time on the forum, thanks for the resource-
simple question -
can anyone tell me how to make forms work - i want a password hiding (****) thing, and as you cant do that with InputBoxes then i think forms are the only option.
i can make the form OK, but can anyone tell me how to verify?
i have a table with headings UserLevel - Password
any help would be ... helpful!
btw im using Excel XP version. thanks
dave
-
Mar 13th, 2002, 09:58 PM
#2
Create your UserForm and add a text box to get the password. Set the text box property PasswordChar to "*", or whatever you want to show when users type into the text box.
-
Mar 13th, 2002, 11:48 PM
#3
On a form . . .
VB Code:
Option Explicit
Public i As Integer
Private Sub cmdOk_Click()
i = i + 1
If i = 3 Then
MsgBox "Sorry, three strikes and your out!"
Unload Me
Exit Sub
End If
If txtPassword.Text <> strPword Then
MsgBox "Incorrect password!" & VBA.vbCr & VBA.vbCr & _
"Make sure caps lock is not on" & VBA.vbCr & _
" and try again", vbInformation + vbOKOnly, "Incorrect Password"
Exit Sub
Else
'password succeeded
'put code here to continue after password success
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
. . . in a module . . .
VB Code:
Option Explicit
Public Const strPword As String = "chickenmcnugget"
'replace that password with whatever you choose
'don't forget to password protect your project!!
Sub Get_Password()
frmPword.Show
End Sub
. . . and here is the form . . .
Good luck !
(I created that form in ExcelXP so you can import it directly into your project)
-
Mar 14th, 2002, 11:15 AM
#4
Thread Starter
New Member
import errors.
not sure why, but the import dies whenever i try it.
anyone else find that error?
thanks for the help. if you cant see any error then what's the form say?
just a "UserName" box and a "Password" Box and a submit button?
sorry: the error is: (from the log)
OleObjectBlob = "frmPword.frx":0000
there's an error in that line of code.
thats hwat the log gives.
Last edited by rogueweb; Mar 14th, 2002 at 11:20 AM.
-
Mar 14th, 2002, 11:54 AM
#5
Wierd!
Yeah, just:
txtUsername textbox
txtPassword textbox
cmdOk command button
cmdCancel command button
set you password character property (at design time) to "*" or whatever
-
Mar 14th, 2002, 05:52 PM
#6
Thread Starter
New Member
thanks
ive got them working on my own now, thanks v. much guys.
the A-level project is that one extra lickle bit better
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|