Import File Path - How do I change the code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mtexplorer
    New Member
    • Feb 2007
    • 5

    Import File Path - How do I change the code

    I am using the following

    DoCmd.TransferT ext acImportDelim, "Specification" , "Table", "C:\file.cs v", No

    And this works fine but I would like to have the user type in the path and have the code reference that field instead of the "C:\file.cs v" that is in the code above.

    I have tried a few items in place of it but it does not seem to be the correct syntax or the correct way to do it. Is there an easy way to accomplish this?

    Thanks for any help.
  • Darren McDonald
    New Member
    • Aug 2010
    • 7

    #2
    attached file demonstrates allowing user to pick the file they want to import.

    Cheers
    darren
    Attached Files

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32663

      #3
      I'm not really clear where your confusion lies. This is a simple case of replacing the literal text ("C:\file.cs v") with a reference to the variable or control used.

      Assume a form with a TextBox control, called txtFile, to allow the operator to enter the address of the file. Your code would be something like :
      Code:
      Call DoCmd.TransferText(acImportDelim, "Specification", "Table", Me.txtFile, False)

      Comment

      Working...