Updating a particular record in a table from a form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vasago
    New Member
    • Mar 2014
    • 46

    #1

    Updating a particular record in a table from a form

    Trying to update a record based on a unbound field on a form named punch id. I am getting a syntax error.

    Code:
    DoCmd.RunSQL "Update [Copy of Employee Work Statistics1] SET "[Trip Sign off] = '" & Me!Trip_S_off & "'"  WHERE [Punch ID] = forms![Royal Time Stamp]![Punch ID]"
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Remove the double quote after the SET keyword.

    Comment

    • Vasago
      New Member
      • Mar 2014
      • 46

      #3
      Thanks for your reply seth. I am still getting a syntax error


      Code:
      DoCmd.RunSQL "Update [Copy of Employee Work Statistics1] SET [Trip Sign off] = '" & Me!Trip_S_off & "'"  WHERE [Punch ID] = forms![Royal Time Stamp]![Punch ID]"

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        Is there a message and or number that goes with the error?

        You also have an extra double quote right before the WHERE.
        Last edited by Seth Schrock; Mar 17 '14, 03:31 PM. Reason: Added another finding.

        Comment

        • Vasago
          New Member
          • Mar 2014
          • 46

          #5
          Removing the extra quotes made it work perfect. Thank you for the help Seth

          Comment

          Working...