Results 1 to 4 of 4
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    246

    Upper case in passord


    Hi,

    I have a user form to enter a password.
    Code:
     If txtPassword = "Loka4" Then
            DoCmd.OpenForm "formName"
    else
    MsgBox "Invalid Password. Please Try Again", vbOKOnly
    end if
    If the user types loka4 or Loka4 the form opens.
    What do I have to do so that the form will open only of Capital L is used.
    Form opens if Loka4 is entered.

    Khalil

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,656
    Use the strComp() with the binary compare argument for the password.
    That will make it a case sensitive comparison.

    https://www.techonthenet.com/access/...ng/strcomp.php

    Code:
    If strComp(txtPassword,"Loka4",0) = 0 Then ...
    or

    Code:
    If strComp(txtPassword,"Loka4",vbBinaryCompare) = 0 Then ...
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    246
    Thanks a lot.
    It worked.

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,656
    Your welcome.
    Good luck with your project.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

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

Similar Threads

  1. Replies: 4
    Last Post: 04-28-2019, 07:19 PM
  2. Change text case from upper to proper case
    By s.nolan in forum Access
    Replies: 1
    Last Post: 12-02-2015, 10:56 AM
  3. Replies: 5
    Last Post: 10-23-2012, 03:55 PM
  4. Upper & Lower Case in table
    By Forums10 in forum Access
    Replies: 4
    Last Post: 01-31-2011, 09:01 AM
  5. Is there a way to force a field do be upper case?
    By newtoAccess in forum Access
    Replies: 1
    Last Post: 11-28-2010, 04:20 PM

Tags for this Thread

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