Results 1 to 6 of 6
  1. #1
    shanmugamgsn is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    17

    Dyanmic location for transfer text

    Hi,

    I have used Transfer text cmd to export query to text in MS access. This works fine.
    path= "D:/test/"
    DoCmd.TransferText acExportFixed,"Query1",path,False
    But i need to change the path dyanmically as my wish when i run this query.
    Like i may save my txt in desktop or C: or D:.
    I dont want to hard code path as above.

    Is there any way to achieve this?
    If i get the dyanmic location stored in path variable i can achieve it.
    But i dont know how to achieve this.

    Actually i was confused

    Docmd.OutputTo acOutputQuery,query1


    Above query prompts me for selecting location.
    But transferText doesn't? why?

    As this application is stored on server. If i give a static path, its exporting in Server D:/test/
    But i need this to be stored in my local. This can be done only if it prompts box for user to select the location.





    Please help me friends.

    Regards,
    Shanmugam

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I do this a lot. I create a Form with a Text Box where the user can enter in the file path they want. Then, a command button runs the TransferText code, incorporating the value of the Text Box in the TransferText code.

  3. #3
    shanmugamgsn is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    17
    Thanks JoeM for your quick reply.

    Can you give a sample DB or any tutorial link for this. This could be helpful for me

  4. #4
    shanmugamgsn is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    17
    But the soultion you gave is like user has to enter whole path in that text box right?
    Can this be done by user by selecting.
    Like a explorer window to select that path.
    then i can store it in a vairable.

  5. #5
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You can do that, though it requires some additional VBA coding. I had used some code that I found a lot time of go. It is a ton of code, but you really just "plug and play".

    I found something that looks a bit promising and is a bit shorter. Try this one out: http://www.vbaexpress.com/kb/getarticle.php?kb_id=284

  6. #6
    shanmugamgsn is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    17
    Thanks JoeM it worked out .........

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Warehouse location adjustment
    By tj63069 in forum Database Design
    Replies: 5
    Last Post: 01-11-2012, 06:19 PM
  2. Hyperlink with full location
    By desk4tbc in forum Access
    Replies: 0
    Last Post: 06-27-2011, 05:18 PM
  3. File Location
    By Mitch87 in forum Programming
    Replies: 1
    Last Post: 02-19-2010, 11:12 AM
  4. Transfer Text to Unbound Form
    By DWS in forum Forms
    Replies: 3
    Last Post: 08-25-2009, 08:04 AM
  5. Transfer text
    By nshaikh in forum Import/Export Data
    Replies: 0
    Last Post: 09-11-2008, 03:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums