Results 1 to 7 of 7
  1. #1
    dccjr's Avatar
    dccjr is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Colorado Springs, CO
    Posts
    138

    Update query error

    I have the following sub to change the users passwork from the default to their entered one. However, when I run through the procedure I get a pop-up "Enter Parameter Value". I am not sure where it is coming from. It is suppose to get the new password from a textbox. Here is what I have:



    Code:
    Private Sub cmdChangePassword_Click()
    Dim strInsertPassSQL As String
        If Me.tbxNewPass1 <> Me.tbxNewPass2 Then
            MsgBox ("Paswords do not match. Please try again.")
            Me.tbxNewPass1.Value = ""
            Me.tbxNewPass2.Value = ""
            Me.tbxNewPass1.SetFocus
        Else
            strInsertPassSQL = "UPDATE Secure SET [Password] =" & Me.tbxNewPass1.Value & " WHERE [EmployeeNo] =" & Me.tbxUserEmpNo.Value & ""
            DoCmd.RunSQL strInsertPassSQL
        End If
    End Sub
    Could one of you guys or gals point me in a direction?hanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, this should help:

    http://www.baldyweb.com/ImmediateWindow.htm

    i would assume password is a text field so would require delimiters. The parameter prompt should tell you what it's looking for too.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    dccjr's Avatar
    dccjr is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Colorado Springs, CO
    Posts
    138
    The update query looks correct. What parameter could it want?

    This is the output from the debug:

    UPDATE Secure SET [Password] =johnsmith WHERE [EmployeeNo] =987654

    Anything else come to mind?

  4. #4
    dccjr's Avatar
    dccjr is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Colorado Springs, CO
    Posts
    138
    By the way, johnsmith is the only other thing in the pop-up.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Like I said, the text value needs delimiters, like:

    strInsertPassSQL = "UPDATE Secure SET [Password] ='" & Me.tbxNewPass1.Value & "' WHERE [EmployeeNo] =" & Me.tbxUserEmpNo.Value & ""
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    dccjr's Avatar
    dccjr is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Colorado Springs, CO
    Posts
    138
    That was it. Thank you very much.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  2. Replies: 8
    Last Post: 08-09-2012, 07:04 PM
  3. Replies: 3
    Last Post: 08-06-2012, 03:29 PM
  4. Syntax Error 3144 in SQL Update Query.
    By Phred in forum Programming
    Replies: 4
    Last Post: 03-02-2012, 02:39 PM
  5. Replies: 3
    Last Post: 07-21-2010, 02:41 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