Can you put a file name in a report header?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I import a .csv file to my access table. Using that table I create some
reports. The user would like the name of the file in the report heading.
The file name is different every day. Is there a way to do this??
 
What method are you using to import the file? If you have a
form with a Browse button, you can store the filename as you
import it -- and then echo that stored value on your reports.

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
I just do the 'get external data' thing. Is there a better way? What is a
browse button?
 
You can store the filename in a table and then use that
table to get the name for your report. For instance, make
the following table:

*SystemDefaults*
SysDefID, autonumber
ImportFilename, text

Since you are importing the file manually, you would need to
update this table manually -- it will just have one record
unless you want to keep a historical record of what you have
brought in.

Then, in your report:

make a textbox control for the filename
ControlSource --> =nz(dFirst("ImportFilename",
"SystemDefaults"))

You could make a form to pick the file -- the code to
process the OK (go get the file and import it) button could
also update the SystemDefaults table.

"Browse" refers to a button that pops up the standard
Windows dialog box to identify a filename

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Back
Top