Insert field on a form into exported file name

  • Thread starter Thread starter Erick C
  • Start date Start date
E

Erick C

Hi everybody -

I have a question that I am hoping someone can help me with. I am not
very good at all when it comes to writing code.
I have a code that creates pdf files and saves them in one of my
folders. Currently there is a portion of the code that assigns the
location and name of the file being created, within this is a part
that sets today's date:

"c:\" & strAcctNum & " " & Format$(Date, "Medium Date") & ".pdf"

I am building some new functionality into the database that will be
used for creating reports with a previous date. I have a table,
"Backdate_Dates", that has a field named Issue Date. I would like to
use this issue date in the name of the pdf file being created. So I
am trying to get to something in the code like:

"c:\" & strAcctNum & " " & Format$([Backdate_Dates]![Issue Date],
"Medium Date") & " " & "backdate.pdf"

I am guessing that I do not have the previous code set up correctly,
since I am pretty sure that the formatting for the code does not work
like setting up a query in Access.
Can anybody help me out with this?

Thanks

Erick
 
Use the DLookup function:

"c:\" & strAcctNum & " " & Format$(DLookup("[Issue Date]",
"[Backdate_Dates]"), "Medium Date") & " " & "backdate.pdf"
 
Thanks Ken!
As always, you are the best!


Use the DLookup function:

"c:\" & strAcctNum & " " & Format$(DLookup("[Issue Date]",
"[Backdate_Dates]"), "Medium Date") & " " & "backdate.pdf"

--

        Ken Snellhttp://www.accessmvp.com/KDSnell/




Hi everybody -
I have a question that I am hoping someone can help me with.  I am not
very good at all when it comes to writing code.
I have a code that creates pdf files and saves them in one of my
folders.  Currently there is a portion of the code that assigns the
location and name of the file being created, within this is a part
that sets today's date:
"c:\" & strAcctNum & " " & Format$(Date, "Medium Date") & ".pdf"
I am building some new functionality into the database that will be
used for creating reports with a previous date.  I have a table,
"Backdate_Dates", that has a field named Issue Date.  I would like to
use this issue date in the name of the pdf file being created.  So I
am trying to get to something in the code like:
"c:\" & strAcctNum & " " & Format$([Backdate_Dates]![Issue Date],
"Medium Date") & " " & "backdate.pdf"
I am guessing that I do not have the previous code set up correctly,
since I am pretty sure that the formatting for the code does not work
like setting up a query in Access.
Can anybody help me out with this?

Erick- Hide quoted text -

- Show quoted text -
 
Back
Top