Jolted_Chicken
Registered User.
- Local time
- Today, 21:51
- Joined
- Nov 7, 2002
- Messages
- 15
I am trying to convert Month numbers to words
eg. 1 -> January, 4 -> April
but i cant get it working....
I've looked at some examples involving converting currency into words but havnt got me anywhere
here's my code for the module MonthNum2Word(int)
I am trying to call this in a text label where in its control value
i've put
=MonthNum2Word([Forms]![fmrMonthlyReports]![ComboMonth])
[Forms]![fmrMonthlyReports]![ComboMonth] is a combo box that allows me to select the month for a query.
eg. 1 -> January, 4 -> April
but i cant get it working....
I've looked at some examples involving converting currency into words but havnt got me anywhere
here's my code for the module MonthNum2Word(int)
Code:
Option Compare Database
Option Explicit
Public Static Function MonthNum2Word(ByVal month_int As Integer) As String
Dim month_word As String
Select Case (month_int)
Case 1:
month_word = "January"
Case 2:
month_word = "Febuary"
Case 3:
month_word = "March"
Case 4:
month_word = "April"
Case 5:
month_word = "May"
Case 6:
month_word = "June"
Case 7:
month_word = "July"
Case 8:
month_word = "August"
Case 9:
month_word = "September"
Case 10:
month_word = "October"
Case 11:
month_word = "November"
Case 12:
month_word = "December"
End Select
'Return Month in words
MonthNum2Word = month_word
End Function
I am trying to call this in a text label where in its control value
i've put
=MonthNum2Word([Forms]![fmrMonthlyReports]![ComboMonth])
[Forms]![fmrMonthlyReports]![ComboMonth] is a combo box that allows me to select the month for a query.