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.
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
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