Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the deal with Combos?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00273965
Message ID:
00274209
Vues:
36
The field value is not originally in the combo's list. While following in the debugger, I do see that this value is successfully added to the arrray in the INIT. At the end of the refresh, as I am following this through the debugger, I see the original data value briefly display in the combo when the command This.DisplayValue = lcOldvalue is run. The very next step blanks the value in the combo AND in the actual field in the source table. For now, I am working directly with a table instead of a view.

To compound the problem, when I click the dropdown button, only the first item in the list [out of 10 items] displays.

OK, this is what I have done so far:
PROCEDURE Init

DoDefault()
select StaffName from travel!supers order by staffname into array This.aList
local lnResult
lnResult = 1
if !empty(This.ControlSource)
	lnResult = ascan(This.aList, eval(This.ControlSource))
endif
if lnResult = 0
	local lnLen
	lnLen = alen(This.aList, 1) + 1
	dimension This.aList[1, lnLen]
	This.aList[1, lnLen] = eval(This.ControlSource)
	This.NumberOfElements = lnLen
	asort(This.aList)
endif
This.Requery()
return

ENDPROC

PROCEDURE Refresh

DoDefault()
local lnResult, lcOldValue
lnResult = 1
lcOldValue = eval(This.ControlSource)
if !empty(lcOldValue)
	lnResult = ascan(This.aList, lcOldValue)
endif
if lnResult = 0
	local lnLen
	lnLen = alen(This.aList, 1) + 1
	dimension This.aList[1, lnLen]
	This.aList[1, lnLen] = lcOldValue
	This.NumberOfElements = lnLen
	asort(This.aList)
endif
This.Requery()
This.DisplayValue = lcOldValue
*This.Value = lcOldvalue

ENDPROC

From the Properties:

BoundColumn = 1
ColumnCount = 1
ColumnWidths = "180"
RowSourceType = 5
RowSource = "This.aList"
ControlSource = "Tainfo.Rofficer"
FirstElement = 1
Height = 24
ColumnLines = .F.
Left = 180
NumberOfElements = 0
Top = 97
Width = 151
Name = "Combo1"
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform