Display Variable Date Value as Label in other Format

WilRel

Registered User.
Local time
Today, 05:55
Joined
Dec 24, 2011
Messages
18
How can I change the format of the value displayed in a label?

I have a Variable named StartDate,
a Label named DisplayStartDate

After the Form has opened, in the event ON OPEN I use the following:

DisplayStartDate.Caption = StartDate

The problem though is that it displays the format set in the declaration of the variable, I presume. (Currently "dd/mm/yy")

If I want to change the displaying format to "dd-mmm-yy", how should I go about?

Thanx
 
Use the Format() function on the variable.
 
Thanks, but

I'm using Access 2003 and as I am using a label, and want to use a label, to show the variable, I cannot find the FORMAT property on the PROPERTY sheet.

As I am a new user, I would appreciate if you could show me it in the right syntax, because I've been looking through the Help File and couldn't get the answer I'm looking for. Maybe I just don't know how to ask the right question.

I would appreciate it...:o
 
THANKS!:D

I went back to Access and thought of what you posted and yes, the light came on.

Everyday a little brigther!!

DisplayStartDate.Caption = Format(StartDate, "Long Date")

or

DisplayStartDate.Caption = Format(StartDate, "dd-mmm-yy")

Regards!

WR
 

Users who are viewing this thread

Back
Top Bottom