Results 1 to 5 of 5
  1. #1
    deepucec9 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    34

    Update query


    How to update value from unbound text box to table.
    tried the following
    DoCmd.RunSQL "Update in SET remquantity_in =" & Me!Text35 & "where out.productid_out = in.productid_in AND out.ponumber_out = in.ponumber_in'"

    but it shows RUN TIME ERROR 3144
    Syntax error in UPDATE statement
    Please help
    Note: recordset type of form is Dynaset (Inconsistent updates) changed when I got some error

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 64bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536

  3. #3
    deepucec9 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    34
    Click image for larger version. 

Name:	query.jpg 
Views:	11 
Size:	205.3 KB 
ID:	22434Click image for larger version. 

Name:	onclick.jpg 
Views:	11 
Size:	136.3 KB 
ID:	22435
    Thank you for the reply, did the same but data is not updated in the table. I want to update to specific record eg: ponumber_out=ponumber_in

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    I suggest you dim a string variable

    DIm strVar as String
    strVar = "Update in SET remquantity_in ="
    strVar = strVar & Me.Text35
    strvar = strVar & "where out.productid_out = in.productid_in AND out.ponumber_out = in.ponumber_in'"
    Debug.print strVar

    But, you have a single quote after
    '"where out.productid_out = in.productid_in AND out.ponumber_out = in.ponumber_in'"
    Debug.print strVar

    But, you have a single quote after
    in.ponumber_in'???

    Bottom line is, build your sql using string variable, then test your constructed SQL using debug.print.

    The output of the debug print should be a valid, rendered SQL statement that you could execute in the query designer.


  5. #5
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    From your post:
    Code:
    DoCmd.RunSQL "Update in SET remquantity_in =" & Me!Text35 & "where out.productid_out = in.productid_in AND out.ponumber_out = in.ponumber_in'"
    Try this:
    Code:
    DoCmd.RunSQL "Update in SET remquantity_in =" & Me!Text35 & " where out.productid_out = in.productid_in AND out.ponumber_out = in.ponumber_in"
    Assuming all productid and ponumbers are numeric/non-text. I removed an errant apostrophe and added a missing space.

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

Similar Threads

  1. Replies: 14
    Last Post: 08-12-2014, 06:33 AM
  2. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  3. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  4. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  5. Replies: 1
    Last Post: 08-19-2011, 12:16 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