Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    2

    Unanswered: Specify path in RunApp Macro with DLookUp

    I want to use a RunApp macro to open a Windows Explorer for a folder that relates to the database item I am viewing on the form. The syntax that I have that doesn't work is:

    explorer \\server address\ & DLookUp("[Serial]", "[Cases]", "[CaseID] = Form![CaseID]")

    If I take away the DLookUp portion of the path the macro works fine but I want to go directly to the folder on my server that has all the files pertaining to the "CaseID".

    Thanks,
    Ted

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    Dim case_id As Integer
    Dim path As String
    
        case_id = DLookUp("[Serial]", "[Cases]", "[CaseID] =" & Form![CaseID])
        
        path = "explorer \\server address\" & case_id
    
        ...
    George
    Home | Blog

  3. #3
    Join Date
    May 2008
    Posts
    2
    George,

    Thanks for your help. Unfortunately, I am an idiot when it comes to VBA, that is why I use Macros. Do you know how to write the syntax as an argument to the RunApp Macro?

    Thanks,

    Ted

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Note the bits highlighted above in red; swap the case_id variable with the dlookup and job's a good'un
    George
    Home | Blog

Posting Permissions

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