|
-
Dec 8th, 1999, 05:04 PM
#1
Thread Starter
Frenzied Member
Format(2,"dddd")
returns
Montag
What function or parameter of format() do I need to get 1 = Januar
12 = Dezember etc??
I can't Hard-code my own because it MUST use the system locale.
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Dec 8th, 1999, 05:10 PM
#2
Member
Format(2,"mmmm")
HTH,
AndyC
-
Dec 8th, 1999, 05:13 PM
#3
The format(2,"mmmm") doesn't work it returns the first month, (2 = 01-01-1900)
Try MonthName.
------------------
Vincent van den Braken
EMail: [email protected]
ICQ: 15440110
Homepage: http://www.azzmodan.demon.nl
-
Dec 8th, 1999, 05:15 PM
#4
Thread Starter
Frenzied Member
Thanks Andy but did you actually test this first?
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Dec 8th, 1999, 05:15 PM
#5
Member
Beg yer pardon you're absolutely right I knew I shouldn't have got up this morning.
Apologies.
AndyC
[This message has been edited by Andy Collyer (edited 12-09-1999).]
-
Dec 8th, 1999, 05:23 PM
#6
Thread Starter
Frenzied Member
I'm using VB5 not VB6 and MonthName isn't available
Anyway, I've just realised that the piece of code I was trying to make locale dependant isn't used anymore.
so I don't need a reply anyway
Thanks for the help though.
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Dec 8th, 1999, 09:52 PM
#7
Try this. Add a ComboBox to your form and paste this code to Form_load event:
Code:
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 11
Combo1.AddItem Format(DateAdd("m", i, "1/1/" & Year(Date)), "mmmm")
Next
End Sub
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 12-09-1999).]
-
Dec 9th, 1999, 07:40 PM
#8
Thread Starter
Frenzied Member
Just incase any one is interested I've turned it into a function
Code:
Public Function MonthName(intMonth As Integer) As String
'by Mark Sreeves
'with thanks to Serge
Select Case intMonth
Case 1 To 12
MonthName = Format(intMonth & "/" & intMonth, "mmmm")
Case Else
MonthName = ""
End Select
End Function
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Dec 9th, 1999, 09:32 PM
#9
Mark, you can make your code a lot simplier, using buid-in VB function called MonthName
MsgBox MonthName(1) - Will return January and so on.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Dec 9th, 1999, 09:44 PM
#10
Hyperactive Member
-
Dec 9th, 1999, 09:57 PM
#11
Yeap, sorry for that. MonthName function is available with VB6 only at the moment.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|