Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I find a value in a Combo and set the ListIndex
Message
From
01/01/2009 11:02:48
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
01/01/2009 02:25:59
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01370437
Message ID:
01370469
Views:
33
>>I have a Combo with Values like this:
>>
>>SUNDAY
>>MONDAY
>>TUESDAY
>>WEDNESDAY
>>THURSDAY
>>FRIDAY
>>SATURDAY
>>
>>If I know a variable value is equal to "MONDAY" how can cause the Combo to display that value in the list?
>>
>>UPDATE: Nevermind. This worked:
>>
>>* JJ - 01/01/2009 - Using the default value for a new record
>>IF m.Mode = 'ADD'
>>	IF m.ControlClass = 'FM_COMBOBOX' OR m.ControlClass = 'FM_COMBOMAINT'
>>		IF !EMPTY(ColumnProps.DefaultVal) AND ColumnProps.RowType = 1
>>			.ListIndex = 1
>>			m.ListCount = OCCURS(',',m.ctrl.RowSource)+1
>>			FOR m.n = 1 TO m.ListCount
>>				IF PADR(UPPER(ALLTRIM(.List[ m.n ])),LEN(ALLTRIM(ColumnProps.DefaultVal))) == ;
>>							ALLTRIM(UPPER(ColumnProps.DefaultVal))
>>					.ListIndex = m.n
>>				ENDIF
>>			ENDFOR
>>		ENDIF
>>	ENDIF
>>ENDIF
>>
>
>If nobody told you, I will: it's a new year... and may you solve all your problems like this :)

I appreciate that, Dragan. I'm not big into the whole new year resolution thing - it just seems like something we should be looking to try all the time, not just once a year - but I am looking to turn a few corners this year. I'm still employed, so that's at least one down. :-D
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform