InputBox

peterbowles

Registered User.
Local time
Today, 16:49
Joined
Oct 11, 2002
Messages
163
I am trying to create an input box where the inputmask ot set to PASSWORD
 
You can not change the format of an input box. You would have to create a form to do what you want
and it is not always worth the extra trouble but your situation might warrant the extra effort and work needed.

If you do not want to use a form and do not mind the simplicity of an input box, try this sub to password protect
the opening of a form (fSpecialForm) from the main menu form...

Code:
Private Sub bOpenFormClick_Click()
On Error GoTo Err_bOpenFormClick_Click
    
    Dim strInput As String
    Dim strMsg As String
    
    Beep
    strMsg = "These functions are used only by the special people." & vbCrLf & vbLf & "Please key the Special Form password to allow access."
    strInput = InputBox(Prompt:=strMsg, title:="Special Form Password")
    If strInput = "SpecialPassword" Then 'password is correct
        Beep
        DoCmd.OpenForm "fSpecialForm"
        DoCmd.Close acForm, Me.Name
    Else 'password is incorrect
        Beep
        MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the special form.", vbCritical, "Invalid Password"
        Exit Sub
    End If
    
bEdit_Click_Exit:
    Exit Sub
    
Err_bEdit_Click:
    MsgBox Err.Number & " " & Err.Description
    Resume bEdit_Click_Exit
    
Exit_bOpenFormClick_Click:
    Exit Sub
    
Err_bOpenFormClick_Click:
    ErrorMsg Me.Name, "bOpenFormClick_Click", Err.Number, Err.Description
    Resume Exit_bOpenFormClick_Click
    
End Sub
'You can not format an input box

'HTH
 

Users who are viewing this thread

Back
Top Bottom