Click here to Skip to main content
15,887,930 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Here is the code it pops up when clicked on the button but does not accept input as password but in text format only.

VB
Private Sub Form_Open(Cancel As Integer)
Dim PassWord As String

   PassWord = InputBox("Enter password")

   If PassWord = "welcome@123" Then
      ' Open Form
      DoCmd.OpenForm "add/update tables form"
    Else
      MsgBox ("You're not authorized - now exiting")
      DoCmd.Close acForm, "add/update tables form"
      End If

      End Sub
Posted
Updated 9-Mar-11 23:26pm
v3

 
Share this answer
 
Comments
sairam.bhat 10-Mar-11 5:42am    
good ans
Maciej Los 21-Nov-11 16:09pm    
Access <> Excel. Forms in MS Access are differ from these in MS Excel. Take a look at my solution.
This might help you
TextBox1.PasswordChar = "*"
 
Share this answer
 
Comments
Maciej Los 21-Nov-11 16:12pm    
In MS Acces textBox'es have not PasswordChar property. They have Mask property, which can be set to PASSWORD.
As you said, you can't set PasswordChar for InputBox.
You need to build own userform (form in MS Access a'ka dialog window) with TextBox which can accept PasswordChar (Mask=Password). Remember to set some properties for form:
Popup = True,
Modal = True,
BorderStyle=Dialog
if you would like to have dialog-modal form (window).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900