VB question

cornishteeth

Board Regular
Joined
Dec 6, 2002
Messages
117
I have the VB code below and works the way I want it. The only question I have is how would I make it to where the input box displays astericks vice the actual input. For example, if I enter 456, 456 is shown in the input box. I want *** to show up in its place. Any suggestions.

Cornish Teeth :eek:

Private Sub Command1_Click()

Dim strPasswd

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

'See if a valid entry made to input box

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

'correct password is entered open Main form Close, Opening Sheet

If strPasswd = "123" Then
DoCmd.OpenForm "Main Form", acNormal
DoCmd.Close acForm, "Opening Sheet"
Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information"
Exit Sub
End If
End Sub
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I don't think that you can control the format iof an Input box. You will need to create a custom form and pop that up in modal to use it like a input box.

Peter
 
Upvote 0

Forum statistics

Threads
1,221,645
Messages
6,161,044
Members
451,682
Latest member
ogoreo

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