Export table to txt file with a variable filename

Discussion in 'Microsoft Access Macros' started by macollins7, Jul 10, 2012.

  1. macollins7

    macollins7

    Joined:
    May 14, 2011
    Messages:
    2
    Likes Received:
    0
    Hello, I tried doing some searching on this but wasn't finding much. I am very comfortable with Excel and so-so at creating macros in Excel with VBA but when it comes to Access I am much more of a rookie.

    My current setup - Access 2007-2010, win7 64bit
    I have a macro that does the following
    - runs saved import to import excel file to table ("Table_Import")
    - runs a make table query ("Query 1") to make new table ("Table 1")
    - runs a make table query ("Query 2") to make new table ("Table 2")
    - runs saved export to export Table 2 as text file ("Export File").

    My dilemma: Query 2 gives the user a prompt [Enter date] where users will enter the date of the records they want to include (ex: 7/10 or 7/10/12) in the final output. What I would like to do is have the name of the txt "Export File" include the variable the user entered (ex: Export File_07.10.12).

    Thanks in advance for any help!
    Michael
     
    macollins7, Jul 10, 2012
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nejc Kovacic

    periodical query export into .txt file

    Nejc Kovacic, Jan 16, 2004, in forum: Microsoft Access Macros
    Replies:
    2
    Views:
    172
    Nejc Kovacic
    Jan 17, 2004
  2. DChitwood

    Export to .txt file

    DChitwood, Feb 26, 2004, in forum: Microsoft Access Macros
    Replies:
    2
    Views:
    162
    Dchitwood
    Feb 26, 2004
  3. kashif

    Export Txt File From Form(Help Me)

    kashif, Feb 29, 2004, in forum: Microsoft Access Macros
    Replies:
    0
    Views:
    154
    kashif
    Feb 29, 2004
  4. DChitwood

    macro to export table to .txt file revisited

    DChitwood, Mar 4, 2004, in forum: Microsoft Access Macros
    Replies:
    3
    Views:
    311
    Guest
    Mar 4, 2004
  5. Guest

    storing Outputto filename into a variable

    Guest, Jun 5, 2004, in forum: Microsoft Access Macros
    Replies:
    0
    Views:
    174
    Guest
    Jun 5, 2004
Loading...

Share This Page