Solved

How to put date and file name in the footer

Posted on 2010-11-09
5
311 Views
Last Modified: 2012-05-10
I am trying to put date and file name in the footer of a file exported from access and print it with preset alignment.

What is the code for the date and file name.
0
Comment
Question by:alibacha
5 Comments
 
LVL 9

Expert Comment

by:jkunrein
ID: 34097115
You should be able to use:
&[Date]
for the date.

And you can use:
&[File]
for the file name.
0
 
LVL 59

Accepted Solution

by:
Saurabh Singh Teotia earned 500 total points
ID: 34097161
You can use something like this to do what you are looking for...
Saurabh...

Sub putfooter()



    With Sheets("Your Sheet name here").PageSetup

     

        .CenterFooter = Format(Now(), "mm/dd/yy") & " " & ThisWorkbook.Name

        

        

    End With

    

End Sub

Open in new window

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34099100
What type of Object are you Exporting?
What format are you exporting it to?
How are you performing the Export (manually or via code)
"and print it with preset alignment."
?
...Can you explain exactly what this means?

Please be specific.


I will presume by what little info on this you posted, that you want some Access Data exported to Excel?

If so, this can easily be done in a Report.

Create the report from your source data.
In the Report footer insert a textbox control and set the control source to: =Date()
Set the name to: txtDate

Then in the Report footer insert another textbox control but leave the control source blank.
Name this control: txtDBName
Then on the Format event of the Report Footer, put code like this:
    Me.txtPath = CurrentProject.Name

See the attached sample.

Study it carefully and I am sure you will be able to adapt it to work in your database.

;-)

JeffCoachman

db310.mdb
0
 
LVL 50

Expert Comment

by:teylyn
ID: 34415208
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now