如何在输入框中输入密码屏蔽? [英] how to put password masking in input box?

查看:121
本文介绍了如何在输入框中输入密码屏蔽?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是单击按钮时弹出的代码,但不接受输入作为密码,而仅接受文本格式.

Here is the code it pops up when clicked on the button but does not accept input as password but in text format only.

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

推荐答案

在那看看:

http://www.mrexcel.com/archive/VBA/19882a.html [ ^ ]
Take a look there :

http://www.mrexcel.com/archive/VBA/19882a.html[^]


这可能帮助您
TextBox1.PasswordChar ="*"
This might help you
TextBox1.PasswordChar = "*"


正如您所说,您不能为InputBox设置PasswordChar.
您需要使用可以接受PasswordChar(Mask = Password)的TextBox构建自己的用户窗体(MS Access中的窗体"ka对话框"中的窗体).请记住为表单设置一些属性:
弹出窗口= True,
模态=真,
BorderStyle =对话框
如果您希望使用对话框模式形式(窗口).
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).


这篇关于如何在输入框中输入密码屏蔽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆