PDA

Click to See Complete Forum and Search --> : Date.........


Rocks
Oct 12th, 2000, 06:21 AM
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.

monte96
Oct 12th, 2000, 10:12 AM
<%
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>

Rocks
Oct 12th, 2000, 10:18 AM
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

monte96
Oct 12th, 2000, 02:45 PM
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.