|
-
Oct 12th, 2000, 06:21 AM
#1
Thread Starter
Addicted Member
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.
-
Oct 12th, 2000, 10:12 AM
#2
Frenzied Member
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..
-
Oct 12th, 2000, 10:18 AM
#3
Thread Starter
Addicted Member
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
-
Oct 12th, 2000, 02:45 PM
#4
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|