Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box with Days of Month
Message
From
25/09/2002 08:33:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/09/2002 08:27:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00704142
Message ID:
00704157
Views:
18
>m.CurrentYear = YEAR(DATE())
>m.maxyear = m.currentYear + 9
>
>
>for i = m.currentyear to m.maxyear
>
> thisform.clpcombo1.rowsource = str(m.currentyear)
> m.currentyear = m.currentyear + 1
>endfor
>
>this only yields me the very last year which is 2011.

It is obvious that this should happen, since you overwrite the variable with another value each time.

Don't use the RowSource. Instead, populate the Combo "manually", as follows:
for i = year(date()) to year(date()) + 9
	This.AddItem(trans(i))
next
Suggestion: Use the HTML code < PRE > for VFP code - this will maintain formatting (and, specifically here in the UT, show syntax coloring). Press "reply" to see how I did it.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform