Calendar Date Format



Thanks in advance -

Trying to get this format returned when selecting a date on a calendar
and having a little difficulty

Format needs to be mmyy/Dayd

Example

Feb 3, 2004 would return 0204\Day3
Dec 15, 2002 would reurn 1202\Day15


Code I have tried

This way actually almost works cept the "y" in "Day" is pulling a 6

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged
Dim selection As String = Format(Calendar1.SelectedDate(),
"MMyy" & "\Day" & "d")
Response.Redirect("\\server\report\" & selection & ".XLS")
End Sub


Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged
Dim monthyear As String = Format(Calendar1.SelectedDate(),
"MMyy")
Dim day As String = Format(Calendar1.SelectedDate(), "d")
Dim selection As String = monthyear & "\Day" & day
Response.Redirect("\\server\report\" & selection & ".XLS")
End Sub

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged
Dim monthyear As String = Format(Calendar1.SelectedDate(),
"MMyy")
Dim day As String = Format(Calendar1.SelectedDate(), "d")
Dim selection As String = monthyear & "\Day" & day
Response.Redirect("\\server\report\" & selection & ".XLS")
End Sub

The response redirect is another problem, but cant move onto that
problem til I get the formating working out...

Thanks!!

JD

.



Relevant Pages

  • Re: parse cell contents
    ... extract the date I will get the yyyy-mm-dd format. ... What we will do is first look at the first word in the string. ... Dim ValidEntry As Boolean ... 'Set the pattern by using the Pattern property. ...
    (microsoft.public.excel.programming)
  • Re: Setting field properties in code
    ... format that the user has defined in the Windows Control Panel, ... >> Sub StandardProperties(strTableName As String) ... >> Dim tdf As DAO.TableDef 'Table nominated in argument. ... >> Dim ind As DAO.Index ...
    (comp.databases.ms-access)
  • Re: Zellformatierung vQ=B6llig_selbstherrlich_=2897=29?=
    ... indem Du das Format selbst exakt defninierst. ... >> Public Sub Sammeln(Name As String) ... >> Dim EingangAs String ... Eine Alternative ist auch der Makro-Recorder während Du eine Zelle als Text ...
    (microsoft.public.de.excel)
  • Re: tab in userform locks program
    ... > I am a VBA newbie and have not been using DIM in my code so it is ... declare a variable at the top of a standard module using Private (module ... You may notice that I used Format$ instead of Format. ... but Format$ returns a String whereas ...
    (microsoft.public.excel.programming)
  • Re: Spellnumber - USD/AFa
    ... >>> format it returns me Afghani which is correct and also when I change ... >> Public Function DollarsAFAAs String ... >> Dim DecimalPoint As Long ... >> Dim TestValue As Long ...
    (microsoft.public.excel.misc)