Date Formatting

J

JamesJ

Trying to display date and time in the following format:

Sunday, April 20 2008 - 2:38 AM

Not sure what the format should be.
Not sure if I should use a label and use the OnTimer.
Had inserted day and time using the ribbon command but
the way I want it display with the full month and day spacing
wouldn't look right.

Any help will be appreciated.
James
 
M

Marshall Barton

JamesJ said:
Trying to display date and time in the following format:

Sunday, April 20 2008 - 2:38 AM

Not sure what the format should be.
Not sure if I should use a label and use the OnTimer.
Had inserted day and time using the ribbon command but
the way I want it display with the full month and day spacing
wouldn't look right.


Lookup Format Property in VBA Help.

You can use a custom format by typing the formatting codes
directly into a text box's Format Property. I think this is
what you want:
ddd, mmm d yyyy \- h:nn AM/PM

Generally, you should avoid using the Timer event unless you
absolutely have to have something happen every timer
interval.
 
F

fredg

Trying to display date and time in the following format:

Sunday, April 20 2008 - 2:38 AM

Not sure what the format should be.
Not sure if I should use a label and use the OnTimer.
Had inserted day and time using the ribbon command but
the way I want it display with the full month and day spacing
wouldn't look right.

Any help will be appreciated.
James

Set the format property of the control to:
dddd, mmmm d, yyyy - h:nn AM/PM
 
J

JamesJ

Nothing is displayed in the text box.
I copied and pasted to the Format Property of the text box.
 
J

JamesJ

I pasted it into the wrong object. Should have pasted it into
the format of the date I inserted onto the form.
Works Fine now.

James
 
J

JamesJ

I thought in order for the time to be updated properly one should
use the Timer event.
 
M

Marshall Barton

Depends on what purpose the time text box is serving.

If the time is saved in a record source field, then you
should set it in an appropriate event (form Dirty or
BeforeUpdate?).

If it is used to provide a clock on the form (not
particularly useful), then the timer event would be
required.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top