Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I find a value in a Combo and set the ListIndex
Message
 
 
À
01/01/2009 00:34:49
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01370437
Message ID:
01370474
Vues:
30
Would just setting value to MONDAY work? Or DisplayValue ?

>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 it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform