Results 1 to 2 of 2
  1. #1
    jquickuk is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2009
    Posts
    4

    Exporting Quieres - Filenames

    Afternoon all,

    I have my Vb script that runs my saved query. It then exports the results into a CSV file.

    What i am having issues with is when i run the query it asks me to type in the date. This then shows the cancellations for that date.
    I am trying to get the date i entered to become the file name.

    Saved query: Cancellations.
    Field name: Cancel_Date



    Currently I have the follwoing.

    filename = "Cancellations.Cancel_Date"

    strFile1 = "C:\website cancellations\Cancellations " & Format(filename, "yyyymmdd") & ".csv"

    it then saves the file fine but as: "Cancellations Cancellations#Cancel_Date"

    Any ideas?

    Thanks
    John

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why don't you do a MsgBox "FileName = [" & filename & "]"
    ...before sreating the strFile1 string and see what you have. You will probably need to use a DLookup() to actually get the value for which you are looking.

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

Similar Threads

  1. Adding filenames to pictures
    By Plumber in forum Forms
    Replies: 1
    Last Post: 02-11-2009, 10:34 PM
  2. Exporting a Switchboard
    By Hawkx1 in forum Forms
    Replies: 1
    Last Post: 07-08-2008, 06:59 AM
  3. Exporting pivot table
    By nesbtech in forum Import/Export Data
    Replies: 1
    Last Post: 04-28-2008, 12:19 PM
  4. Exporting a Report to Excel
    By bullwinkle55423 in forum Reports
    Replies: 0
    Last Post: 12-11-2007, 10:27 AM
  5. Exporting a chart to Excel?
    By hraup in forum Access
    Replies: 0
    Last Post: 08-31-2006, 12:21 PM

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