Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 15th, 2004, 12:15 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default Hiding text keystrokes for passwords

I am using this code to create a password protected form, but it shows the text being typed into the InputBox as text. I want to turn it into *****. Any help?

'Attached to On Click event of a button to Open Form

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered open form
'If incorrect password entered give message and exit sub

If strPasswd = "password" Then
DoCmd.OpenForm "frmNewForm", acNormal

Else
MsgBox "Sorry, you do not have access to this form", _ vbOKOnly, "Important Information"
Exit Sub
End If

mmcdonal
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old March 15th, 2004, 02:04 PM
Authorized User
 
Join Date: Feb 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Set the Input Mask property to password on the table for the field (if stored in a table) and for the textbox control into which this is entered.

Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]
 
Old March 15th, 2004, 03:19 PM
Authorized User
 
Join Date: Nov 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Set the Input Mask property to password on the table for the field (if stored in a table) and for the textbox control into which this is entered.

Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]
It is not my intent to be disrespectful but, I believe this is the shortest response I've seen from Jürgen in the past few weeks. Unfortunately, I think you may have missed the mark on this one Jürgen. If I understand correctly, mmcdonal is seeking to mask the text for the password as it is typed in the input box.

I don't have the answer yet, but you may have to change from an Inputbox response to calling a form that contains a text box with the input mask property set to password as Jürgen suggested. You can set other properties on the form, such as modal and dialog, to make it appear as an Inputbox and then perform your authentication routine in the Onclick event on the Ok button of this "pop-up password entry" form.

I'll keep searching to see what I can find on this subject. If I come up with anything, I'll post it here. In the meantime, good luck with your project.




Darrell L. Embrey
 
Old March 15th, 2004, 04:09 PM
Authorized User
 
Join Date: Feb 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Darrell:

You're 100% correct. I recall that Access 97 had some formatting character codes (for msgbox and inputbox) which no longer worked in Access 2000 (don't know about subsequent versions) but these did never did include a password mask. I believe the definitive word was:

http://www.mvps.org/access/general/gen0020.htm



Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]
 
Old March 16th, 2004, 04:18 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Thanks folks, I will work on this form. I will need to look up how to take the form value and pass it back to the variable strPasswrd.

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Keystrokes (Java 5) NEO1976 Pro Java 0 February 29th, 2008 06:44 AM
sending keystrokes to www.whereis.com.au tappenchris Excel VBA 5 November 21st, 2006 08:08 AM
hiding empty text boxes in an Access report EricTheViking Access 4 September 7th, 2006 11:43 AM
Sending Keystrokes to Application [email protected] Pro VB.NET 2002/2003 1 January 18th, 2005 12:53 PM
Hiding Keystrokes kromlic Beginning VB 6 3 June 12th, 2003 04:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.