Solved

How to put date and file name in the footer

Posted on 2010-11-09
5
338 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:Ingeborg Hawighorst
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

828 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