Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160

    Unanswered: Update query using a string in the criteria

    Hi there,

    I'm sure this is an easy one to resolve but i can not for the life of me figure it out.

    DoCmd****nSQL "UPDATE PSA SET PSA.Ref_ID = (NewRef_ID) WHERE (((PSA.Ref_ID) = 'Temp'))"

    NewRef_ID is a string which contains a value which i want to use, so field Ref_ID gets updated with the value held in NewRef_ID.

    When i run the query i get a pop up box asking me to enter the value for NewRef_ID.

    thanks
    Marcus

  2. #2
    Join Date
    Nov 2011
    Posts
    413
    Does Temp have a value?

  3. #3
    Join Date
    Sep 2010
    Location
    UK
    Posts
    160
    Hi there,
    Temp is just the value in the field Ref_ID.

    When I create a new record I call it temp by default. I then want to change this to the value held in NewRe_ID

    Thanks
    Mark

  4. #4
    Join Date
    Nov 2011
    Posts
    413
    If PSA.Ref_ID = "Temp" Then
    NewRef_ID = PSA.Ref_ID


    Is this what you are asking it to do?

    Seems to me you are asking it backwards?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •