Results 1 to 3 of 3
  1. #1
    kiwikiki718 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Posts
    11

    Automaticly genrate file Path name with Query

    Hello, I have a database I use to export data into excel to send out emails. Currently to generate the path of a file, I have to export the data from the table into a report and then then insert a code to generate the path file name for the attachment before exporting to excel. The Email table includes the following fields: EmailAddress, Case, Subject, Body,Date and Attach(Blank). I wanted to know if there was a way to generate the path file name using a query so that I can input the path directly into the Email table instead of the report? and if so how.



    I have tried to create a query to automatically generate the file name but get a error because of the "" and other invalid syntax

    here is the path name I created in the report that works but I am unable to put this code in a query:

    C :\Users\Earl_000\Documents\Pic\[Case]\[Date].pdf



  2. #2
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,357
    What you want is concatenation, which can be tricky at times. Suggest you research it, but if you put this in a query design grid in the field row, you should get a result with a field name of Test.
    Test: "C :\Users\Earl_000\Documents\Pic" & [Case] & "" & [Date] & ".pdf "
    If you're in the mood to do more research, check out naming conventions and reserved words. Date is a poor choice for any db name, and the use of brackets as part of a field (Attach(Blank) ) name is not good either.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    kiwikiki718 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Posts
    11
    Great, This works!, I will read up on the links you provided. Thanks!!

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

Similar Threads

  1. Replies: 2
    Last Post: 01-13-2015, 07:16 AM
  2. Replies: 13
    Last Post: 12-12-2013, 07:22 PM
  3. Replies: 3
    Last Post: 07-30-2012, 02:16 PM
  4. genrate number automaticlly
    By sarab565 in forum Access
    Replies: 1
    Last Post: 07-10-2012, 06:06 AM
  5. Replies: 10
    Last Post: 03-04-2012, 12:17 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