Make Input Box Value Case Sensitive & Hide Characters That Are Inputted

dgj32784

Registered User.
Local time
Today, 00:02
Joined
Mar 22, 2011
Messages
21
I have a command button control hidden on a main form screen that will unhide the Access window, ribbon, and command bars that are set to be hidden on form open (the main form is set to be default on dbase open). My questions are: 1) Can I make the "Passw0rd" case sensitive? It currently works with either an uppercase "P" or lowercase "p". 2) Can I disguise the characters entered into the input box (i.e., ********, etc.)? I can currently see the text "Passw0rd" as it is typed into the input box.

Code:
Private Sub cmdShowHidden_Click()
    'Declare variable for input box value
    Dim strResponse As String
    'Specify input box prompt
    strResponse = InputBox("If you are seeing this message box and do not understand why, press Cancel." & vbCrLf & vbCrLf & "Otherwise, enter the password and press OK.")
    'Sets input box response to given password
    If strResponse = "Passw0rd" Then
        'Show database window
        DoCmd.SelectObject acTable, , True
        'Show the ribbon
        DoCmd.ShowToolbar "Ribbon", acToolbarYes
        'Show the menus and toolbars
        Dim intCommandBars As Integer
            For intCommandBar = 1 To CommandBars.Count
            CommandBars(intCommandBar).Enabled = True
            Next intCommandBar
    Else: Exit Sub
    End If
End Sub

Also, if anyone knows of a more elegant way to achieve the window, ribbon, and command bars hide operation, please share. FYI - I have another hidden command button to re-hide these components if they have been unhidden by a dbase administrator.

Thanks in advance,
David
 
Personally, I would just create a form myself for the password input. Then on the text box you can set the format to PASSWORD and it will display only ***** instead of clear text. You can open it with WindowMode:= acDialog so it waits for input before moving on to the next line of code.
 

Users who are viewing this thread

Back
Top Bottom