Outlook Time Picker

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • scott

    Outlook Time Picker

    I'm trying to create a drop-down that populates choices with time increments
    from 1:00 AM to 12:00 AM, just like Outlook displays. Below code does loop,
    but I can not seem to get my hours to increment right or get AM and PM
    correct. Any better way to accomplish this?

    vLookupCalendar Times= ""

    Dim m,h,iHour,i
    h=1
    iHour = 1
    r=1

    For m = 1 to 48

    r = m Mod 2

    If m < 25 Then
    sTimeAMPM = " AM"
    Else
    sTimeAMPM = " PM"
    End If

    If m = 1 Then
    vLookupCalendar Times = iHour & ":00:00" & sTimeAMPM
    Else
    Select Case r
    Case r <> 0
    vLookupCalendar Times = vLookupCalendar Times & "|" & "M" & m
    & " - " & iHour & ":00:00" & sTimeAMPM
    Case Else
    vLookupCalendar Times = vLookupCalendar Times & "|" & "M" & m
    & " - " & iHour & ":30:00" & sTimeAMPM
    End Select
    End If

    m = m + 1
    iHour = iHour + 1

    Next

    count = 0

    xLookupCalendar Times = Split(vLookupCa lendarTimes, "|")

    Response.Write "<select name=""StartTim e"">"
    Response.Write "<option selected>--Select Time--"

    For Each x In xLookupCalendar Times

    Response.Write( "<OPTION class=""FormTex tBox"" value=""" &
    xLookupCalendar Times(count) & """>" & xLookupCalendar Times(count) &
    "</OPTION>")

    count = count + 1
    Next

    Response.Write( "</select>")


  • scott

    #2
    Re: Outlook Time Picker

    I've got it going. I missed the obvious.


    "scott" <sbailey@milesl umber.com> wrote in message
    news:e8L1G4gYFH A.3132@TK2MSFTN GP09.phx.gbl...[color=blue]
    > I'm trying to create a drop-down that populates choices with time
    > increments from 1:00 AM to 12:00 AM, just like Outlook displays. Below
    > code does loop, but I can not seem to get my hours to increment right or
    > get AM and PM correct. Any better way to accomplish this?
    >
    > vLookupCalendar Times= ""
    >
    > Dim m,h,iHour,i
    > h=1
    > iHour = 1
    > r=1
    >
    > For m = 1 to 48
    >
    > r = m Mod 2
    >
    > If m < 25 Then
    > sTimeAMPM = " AM"
    > Else
    > sTimeAMPM = " PM"
    > End If
    >
    > If m = 1 Then
    > vLookupCalendar Times = iHour & ":00:00" & sTimeAMPM
    > Else
    > Select Case r
    > Case r <> 0
    > vLookupCalendar Times = vLookupCalendar Times & "|" & "M" & m
    > & " - " & iHour & ":00:00" & sTimeAMPM
    > Case Else
    > vLookupCalendar Times = vLookupCalendar Times & "|" & "M" & m
    > & " - " & iHour & ":30:00" & sTimeAMPM
    > End Select
    > End If
    >
    > m = m + 1
    > iHour = iHour + 1
    >
    > Next
    >
    > count = 0
    >
    > xLookupCalendar Times = Split(vLookupCa lendarTimes, "|")
    >
    > Response.Write "<select name=""StartTim e"">"
    > Response.Write "<option selected>--Select Time--"
    >
    > For Each x In xLookupCalendar Times
    >
    > Response.Write( "<OPTION class=""FormTex tBox"" value=""" &
    > xLookupCalendar Times(count) & """>" & xLookupCalendar Times(count) &
    > "</OPTION>")
    >
    > count = count + 1
    > Next
    >
    > Response.Write( "</select>")
    >[/color]


    Comment

    Working...