Display weekday name in control

not_rich_yet

Registered User.
Local time
Today, 05:06
Joined
Mar 19, 2002
Messages
39
Is there a way I can display the name of the weekday in a text box? ie display Monday, Tuesday, Wednesday etc etc?

Thanks,

nry
 
Put this in a module:

Function DayOfWeek(UserDate)
'
'Return calander day for date in long format - Monday, Tuesday etc.
'
DayOfWeek = Format(UserDate, "dddd")
End Function

Then use it as the control source of your text box like this "=DayOfWeek([DoB])"

Where [DoB] is the name of a field with a date in it.

In this example DoB stands for Date of Birth.

You could replace [DoB] with Date() and you would then get todays weekday.
 
Hmm, this gives me '#Name?' in the relevant text box?
 
Rupert's function requires that you pass it a date. A simple solution if you just want today's day name is:

= Format(Date(), "dddd")
 

Users who are viewing this thread

Back
Top Bottom