• DoCmd an Update Query? (AXP 10.2627.2625)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » DoCmd an Update Query? (AXP 10.2627.2625)

    Author
    Topic
    #367361

    I understand how to run an update query using SQL as a string.

    I would like to know, if it is possible, is there a way to pass a parameter to an update query for the value that is to be updated using DoCmd?

    For example: here’s the SQL:

    UPDATE FilePaths SET FilePaths.[Value] = [somepath]
    WHERE (((FilePaths.FilePathName)="TheFiles"));
    

    How do I write

    DoCmd.myQuery something, something, something
    

    to update [somepath]? Is what I am asking a reasonable approach?

    Viewing 0 reply threads
    Author
    Replies
    • #572506

      You could build your own sql string.

      strSQL = "UPDATE FilePaths SET FilePaths.[Value] = '" & _
         strSomePath & "' WHERE (((FilePaths.FilePathName)="TheFiles"));"
      DoCmd.Execute strSQL
      • #572509

        Thanks Francois – That looks to be the most efficient way to do it

    Viewing 0 reply threads
    Reply To: DoCmd an Update Query? (AXP 10.2627.2625)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: