Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Supermover and PKs
Message
From
21/03/2003 16:33:41
Peter Easson
Catalina Trading
Sydney, Australia
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00768363
Message ID:
00768793
Views:
17
OK,
With my subclass of Combo, I added an array called aPicklist in the class designer so that it was always available for all child classes. I also added a property called PKValue. The code for the InteractiveChange event in the 1st Child was
if This.ListIndex > 0
   This.PKValue = This.PickList[This.ListIndex,1]
endif
For any subclass from now on, during its Init, create another array (from for example) a Select statement like
SELECT PKCUST,cName,cSurname from CUST where cSurname = "COX" into array aArray
and the rest would be
 ACOPY(aArray,This.aPickList)
for m.i = 1 to alen(aArray,1)
   This.AddItem(This.aPickList[m.i,2] + This.aPickList[m.i,3],m.i,1)
endfor
&& if you want to make the first item the default
This.Selected(1) = .t.
THis.PKValue = This.aPicklist[This.ListIndex,1]
DoDefault()
Now, everytime the user changes the seletion in the Combo, the real PK value is always available with This.PKValue

Hope this helps

Pete
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform