Probably a simple answer

od_gwyn

New member
Local time
Today, 15:41
Joined
Feb 6, 2004
Messages
7
I'm making a module that returns the Name of todays Month, all i want to know is how to return this value. i.e. what do i put in the module so that when it is run, a value is returned.

e.g. TextBox.Text = TodaysMonth()

Sub TodaysMonth()
MyDate = Now() 'Returns todays month name
MonthNo = Month(MyDate)
MyMonthName = MonthName(MonthNo)
End Sub

I want the text box to show 'MyMonthName'
 
Even easier: ;)

=Format(Date(), "mmmm")
 
For future reference though - subs don't return values; functions do.


i.e

Code:
Function TodaysMonth()
    TodaysMonth = Format(Date(), "mmmm")
End Function
 
Mile-O-Phile said:
Even easier: ;)

=Format(Date(), "mmmm")

and even easier, easier is to just set the display format to MMMM and set the control source to =Date()
 

Users who are viewing this thread

Back
Top Bottom