|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Password with Asterisk
Access 2003 or 2007
I many cases I will create a button to a form that asks for a password first before the form will open. Code:
Private Sub cndAdminArea_Click()
Dim password As String
Dim Answer As String
password = "admin"
Answer = InputBox("Enter Admin Password: ", "Admin Confirmation", "Enter Password")
If Answer = password Then
DoCmd.OpenForm "frmUpdate"
Else
MsgBox "You have not entered the correct password" & vbLf & _
"Please check the password and try again OR contact the real Administrator"
Exit Sub
End If
End Sub
Problem is that someone looking over your shoulder could see the password. Can this password protection be coded to show Asterisk's instead of the actual password? Could someone help me with that code. Any help here will be appreciated. Thanks in advance Dave |
|
#2
|
|||
|
|||
|
I have tried adding this to the code
Code:
InputBox.PasswordChar [=*] either I have the syntax wrong OR got it in the wrong place any suggestions? |
|
#3
|
|||
|
|||
|
Quote:
I had the same problem. I got around it by formatting the box to use Wingdings font type. However, if you have a passwords table, you would use the Password datatype, which would return the asterisks in place of the letters. |
|
#4
|
|||
|
|||
|
Quote:
Thanks for the reply If I create a Passwords table (which is not problem and may in fact be a good idea) How do I "CODE" my above code to read from that table? EDIT: and to go with your original idea - how would I format the "InputBox" for a particular font? |
|
#5
|
|||
|
|||
|
Formatting the text box
The easiest way is to select the text box for the password (in design mode, obviously) and select a font from the toolbar at the top. Alternately, you can right-click on the text box and select "properties" to bring up a whole host of possibilities, including changing the font style, size, border, etc. You could also make the font size 1 pt, which is too small to be seen.
As for using a table for passwords, selecting "Password" for data type will give you the effect you want for the text. How to call it from the form, I dunno. It's one of those things I'm working on myself. |
|
#6
|
||||
|
||||
|
In your text box for your password, right click to open the properties. On the data tab, select format, at the far right of the box, click on the drop down, and select password. All characters will now be populated with asterisks as you key in the password. If password is not an option, customize it.
(This can also be set using format in the table if there is an underlying bound table.) |
|
#7
|
|||
|
|||
|
Excellent, Alan! Thank you.
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Password with Asterisk |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|