Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox Questions
Message
 
To
10/11/2007 03:58:13
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01267056
Message ID:
01268560
Views:
22
Fabio:
My solutions seem to be working fine. Both of them involved creating a RowSource_Assign method and putting code in it. Here is what my code now looks like:

LPARAMETERS vNewVal

*Notejk: To make sure that m.vNewVal is Table.Field
IF !"."$m.vNewVal.AND.!"->"$m.vNewVal.AND.!EMPTY(m.vNewVal)
m.vNewVal = ALLTRIM(m.vNewVal) + "." + ALLTRIM(FIELD(1, m.vNewVal))
ENDIF

THIS.RowSource = m.vNewVal &&Notejk: So the ListCount works in the next line

IF This.ListCount < This.ListIndex &&Notejk: To make sure that they don't go out of sync
This.ListIndex = 1
ENDIF
This.Enabled = (This.ListCount > 1) &&Notejk: To solve problem 1

*Notejk: To prevent infinite loop and avoid changing empty RowSource
IF !"STRTR"$This.RowSource.and.!EMPTY(This.RowSource)
This.RowSource = "STRTRAN(" + m.vNewVal + ", '|')" &&Notejk: To solve problem 2
ENDIF

Jerry Kahn
Previous
Reply
Map
View

Click here to load this message in the networking platform