Results 1 to 6 of 6
  1. #1
    Paulb is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    3

    Vba on a form button prompts for password but then stops

    The following VBA works up to a point then stops saying it doesn't recognise txt box

    Private Sub Text24_Click()


    Dim strPassword As String
    strPassword = InputBox("Please enter the password:")
    If strPassword = "YourPassword" Then

    Me!txtTextBox.Enabled = True

    Else
    Call MsgBox("The password you entered was incorrect")

    End If
    Last edited by Paulb; 11-26-2013 at 03:58 AM. Reason: Underlined where the program stops

  2. #2
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Check if the name of the Textbox is matching or not.

  3. #3
    Paulb is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    3
    Bit of a novice on VBA where in the line Me!txtTextBox.Enabled = True would it go

  4. #4
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    The code is perfect as tested, but i could happen if the name of the textbox is different due to whoch the code unable to recoznise the textbox. Could happen the name supplied to it is incorrect or place me.txttexbox.enable = true

  5. #5
    Paulb is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    3
    Many Thanks managed with your help to get it up and running (text box name was incorrect)

  6. #6
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    My pleasure

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

Similar Threads

  1. Replies: 12
    Last Post: 12-07-2015, 07:10 PM
  2. Replies: 2
    Last Post: 12-24-2012, 10:15 PM
  3. Replies: 1
    Last Post: 06-22-2012, 08:05 AM
  4. Form with multiple subforms, many prompts
    By funkstrong in forum Forms
    Replies: 2
    Last Post: 10-12-2011, 11:40 AM
  5. Password Protect button on Switchboard
    By rosaj in forum Access
    Replies: 1
    Last Post: 08-04-2011, 11:08 AM

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