Date/Time Stamp in Report

SueBwork

Registered User.
Local time
Today, 13:27
Joined
Apr 22, 2005
Messages
21
Greetings. I have a report (actually all of my reports in an MDB) that
I want to date/time stamp at the bottom.

Previously, I had used the builtin function of Now(). I thought that
would give me a date and time value in the format: "month day, year
hour:minutes:seconds". However, I noticed that only the date was
printing (e.g.; January 23, 2006). This is in Access 2000.

BTW ... The way I display the date/time stamp in a text field with the
ControlSource set to "=Now()" in the properties window while in Design
Mode.

So ... in order to get the time value added to the display I changed the
ControlSource to

=Date() & "...." & Time()

Funny thing, though ... the time (hh:mm:ss) value changes on every
printed page. I would have like to keep the time value the same for the
entire printed report.

I am running this on Access 2000.

1. Any ideas why this is happening?
2. Is there a way to get the same timestamp on every page of a printed
report?

Thanks, much.
Sue
 
You should be able to just use:
=Format(Now(),"mmmm d, yyyy hh:nn:ss")
 
Thank you. That worked just fine.

Two points, though ...
1. When I typed in =Format(Now(),"mmmm d, yyyy hh:nn:ss")
Access changed it to =Format(Now(),"mmmm d"", ""yyyy hh:nn:ss")

I ran the report, anyway, and it work just fine ... sort of ...

2. The time stamp changes for each printed page. It's getting the time for each print of a page instead of taking a time stamp for the report and using that time stamp for each page. Is there anyway to get around this? Do I have to do this in the VBA module behind the report, get the system time and plop it into the text box control for each printed page? Is so, at which event would I do this?

Thanks so much.
 
To set the time static you could set a variable when the report is opened and then use VBA to set the value for the text box.

So, in the On Open event of the report -

Me.YourTextBoxName = Format(Now,"mmmm d, yyyy hh:nn:ss")
 
Thanks, once again. It worked with a little modification ...

1. Had to delete the text box and replace it with a label because it became an unbound field and I got some errors during run time attempting to set a value to the textbox. Then I tried to set the value to the ControlSource of the text box but that wouldn't work, either.

So ...

2. I created a label in it's place
3. In the VBA in the Open event, I set the Caption property of the label to the format statement that you sent to me.

That worked like a charm. All pages have the same date/time stamp.

Happy Holidays to you!
 

Users who are viewing this thread

Back
Top Bottom