?
Solved

How to put date and file name in the footer

Posted on 2010-11-09
5
Medium Priority
?
365 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
4 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 2000 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
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

839 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