How can I format an Input box to Password style ***** ?

jdowski

Board Regular
Joined
Apr 21, 2002
Messages
235
I have an inputbox that prompts a user to enter a password..part of the function is below. I just want when the user types in the password for it to be in ****** or password format ?????

Do
Response = InputBox("Enter Password", "Hold on a minute there...")

If Response = PW Then
If CurrentType = acForm And CurrentName = "mainmenu" Then
Else
Exit Function
End If
Application.SetOption "Show Hidden Objects", "Yes"
Forms![mainmenu]![EnterRegion] = 1234
DoCmd.Close
DoCmd.RunCommand acCmdWindowUnhide
Exit Function
Else
MsgBox "Password not correct...", , "Wrongo !"
Try = Try + 1
If Try = 3 Then
DoCmd.Close
End If

End If
Loop
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi
You cannot do this with a standard VBA inputbox. You can however create a userform with a textbox on which you can set the mask to 'password'
HTH
Jim
 
Upvote 0
jsi said:
Hi
You cannot do this with a standard VBA inputbox. You can however create a userform with a textbox on which you can set the mask to 'password'
HTH
Jim

Thanks Jim....I guess I'll either have to live with it the way that it is or, like you said, build a form and put the format into the form.

Thanks guys !!! (y)
 
Upvote 0
Hi Norrie
Nice bit of code. Being a newbie here I don't like to argue ... actually that's a lie I love to argue but that's besides the point LOL :)
To my mind, that is not a standard vba inputbox, that is simply a function that creates a form that behaves like a standard inputbox (it is entirely possible that I have mis-read/-understood the code that I briefly scanned there tho' :) ) which can then be imported as a class. But as I say, nice bit of code, I've copied it and will definitely play with it.
Cheers
Jim
 
Upvote 0
Jim

You are right, I posted the wrong link. There is a way to do it using standard inputbox and API.

Try a search on Inputbox & password.
 
Upvote 0
Sweet, I have no use for this type of function, but here's the link Norie was referring to - code from dk:

http://www.mrexcel.com/board2/viewtopic.php?t=44926&highlight=password+inputbox

But, a persistent question that the 2nd poster brought up.

Wouldn't creating a form with a password masked textbox be easier than all of the above?

Way I see it, you'd...create form. Resize it. Add textbox. Change the mask to password. Takes about 30 seconds total.

Mike
 
Upvote 0
Mike
Wouldn't creating a form with a password masked textbox be easier than all of the above?
Yo've got my vote (and I think Norrie's too) but it's never bad to see another way of skinning the cat. :)
Jim
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,662
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top