Results 1 to 6 of 6
  1. #1
    charly.csh is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2014
    Posts
    186

    Open a Form with a Texbox showing info on Password Format

    Hi everyone!

    I am doing a form with some info that it's confidential for some users and it just should be available for the ones who has the password according to their user
    What I want is once the form will be opened this textbox shows the field in password format and when the password will be get in makes the change to "normal" format

    I don't remember making this change on code, only I remember like Format(Field, ) and cannot find more info

    I highly appreciate the help

    '******************
    'Form 1

    'Login

    Private Sub UpdateLoginInfocmd_Click()

    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "Form2"


    stLinkCriteria = "[User]=" & "'" & Me.Usertxt & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    'I also want to open both on password format
    [Forms]![Form2]![SafetyQuestion].Enabled = False
    [Forms]![Form2]![SafetyAnswer].Enabled = False

    End Sub

    'Form 2

    Private Sub Passwordtxt3_AfterUpdate()

    If Me.Passwordtxt3 = Me.Password Then

    'Here I want to get back the "normal view" and take the password view out

    Me.SafetyQuestion.Enabled = True
    Me.SafetyAnswer.Enabled = True

    Else

    Me.SafetyQuestion.Enabled = False
    Me.SafetyAnswer.Enabled = False

    End If

    End Sub

    '**********************
    Thanks in advance for the help!!!

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You should be able to do that by using setting InputMask to "Password" on open and remove it after the password was entered.
    https://learn.microsoft.com/en-us/of...tbox.inputmask

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    charly.csh is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2014
    Posts
    186
    Excelent idea!
    Just one question... for example I did this
    [Forms]![Form2]![SafetyQuestion].InputMask = "Password"
    [Forms]![Form2]![SafetyAnswer].InputMask = "Password"

    and it worked good!!

    Once I get in the password How Do I remove this "password view", what is the code to get back to the "normal view"?

    Thanks for the help!!!

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,860
    Never had to do it but.....?

    Code:
    [Forms]![Form2]![SafetyQuestion].InputMask =""
    
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    charly.csh is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2014
    Posts
    186
    Thank you both, it was exactly what I needed!

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 33
    Last Post: 01-11-2017, 04:56 AM
  2. button a form to open But with password
    By azhar2006 in forum Forms
    Replies: 2
    Last Post: 04-08-2015, 11:24 AM
  3. Replies: 6
    Last Post: 10-25-2012, 04:13 AM
  4. Code info on Open form
    By FRSPA in forum Access
    Replies: 3
    Last Post: 07-02-2012, 04:37 PM
  5. Format info on form by type
    By zoomer56 in forum Forms
    Replies: 1
    Last Post: 02-29-2012, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums