Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DoCmd an Update Query? (AXP 10.2627.2625)

    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:
    <pre>UPDATE FilePaths SET FilePaths.[Value] = [somepath]
    WHERE (((FilePaths.FilePathName)="TheFiles"));
    </pre>

    How do I write
    <pre>DoCmd.myQuery something, something, something
    </pre>

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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd an Update Query? (AXP 10.2627.2625)

    You could build your own sql string.
    <pre>strSQL = "UPDATE FilePaths SET FilePaths.[Value] = '" & _
    strSomePath & "' WHERE (((FilePaths.FilePathName)="TheFiles"));"
    DoCmd.Execute strSQL</pre>

    Francois

  3. #3
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd an Update Query? (AXP 10.2627.2625)

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

Posting Permissions

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