Results 1 to 4 of 4

Thread: Date.........

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    137
    Hi all,

    Need some help/advice on the following issue pls.

    I would like to populate a combo box with value of the months.

    I want the box to be populated with the month of September and October, and for the box to add the current month in automatically. i.e if I ran the app in December I would want all months from September to December to be populated in the box.

    Any ideas please.


    join me in the platinum

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Code:
    <%
    Dim intloop
    Dim intMonth
    
    intMonth = Month(Date)
    %>
    <HTML>
    <BODY>
    <SELECT id=Months>
    <%If intMonth > 9 Then
        For intLoop = 9 to intMonth
            Response.Write "<OPTION value=" & intLoop & ">" & MonthName(intLoop) & "</OPTION>"
        Next
    End If%>
    </SELECT>
    </BODY>
    </HTML>
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    137

    thanks....more

    Thank you for that, but that does not add the year in and it is in HTML....

    I'm sorry if I don't sound greatfull, it is just that I am very new to coding.

    I have managed to populate the CBOX with the month and year but it has done that on a daily basis i am trying to use the adddate to set the interval to a month but am having no joy:::

    Sub GetDate()
    FirstDate = "01/09/2000"
    m = FirstDate

    For n = m To Date
    AnalystCallMonitor.cbMonthFr.AddItem Format(n, "mmm yyyy")
    DateAdd("m", 1, Date) = m
    Next n


    or

    FirstDate = "01/09/2000"
    '' m = FirstDate
    '' Do While m <= Date
    '' AnalystCallMonitor.cbMonthFr.AddItem (Format(m, "mmm yyyy"))
    '' m = DateAdd("m", 1, Date)
    '' m = m + 1
    '' Loop
    '' End Sub


    what i cant do here is make m = m + 1 month????

    any ideas,

    Once again thank you mate
    join me in the platinum

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Well.. your answer was in HTML and ASP cuz that's what this forum is..

    looks like you need to change your "m" to "M". Some date functions consider "m" as minutes and "M" as months.

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width