Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Databound combo box question
Message
From
21/10/2001 21:00:01
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00571466
Message ID:
00571521
Views:
21
Kirk-

>I have a combo box with the following:
>
>
>BoundColumn=2
>BoundTo=.t.
>ControlSource = gnViewDept
>RowSource=v_userDepts.deptdesc,deptid
>RowSourceType=6-Fields
>
>
>
>My problem is that when the form load, the combo box shows the department name based off gnViewDept. But when I use the combo to change the departments, the displayvalue goes blank. gnViewDept is updated to reflect the newly selected department, and the control when I click on it shows all the departments, but after the drop-down closes, nothing is displayed. If I change BoundTo to False, the control maintains it display value, but gnViewDept doesn't get updated.

I wasn't able to duplicate the bug with the following code:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


**************************************************
*-- Form:
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   10/21/01 05:51:13 PM
*
DEFINE CLASS form1 AS form


	Height = 66
	Width = 228
	Caption = "Form1"
	temp = "0,0"
	Name = "Form1"


	ADD OBJECT combo1 AS combobox WITH ;
		BoundColumn = 2, ;
		ColumnCount = 2, ;
		ColumnWidths = "100,0", ;
		RowSourceType = 6, ;
		RowSource = "temp1.c1,n1", ;
		<font color="red">ControlSource = "gnTemp", ; && Change this to "Thisform.Temp" to see the property bug</font>
		Height = 24, ;
		Left = 6, ;
		Top = 24, ;
		Width = 100, ;
		BoundTo = .T., ;
		Name = "Combo1"


	ADD OBJECT text1 AS textbox WITH ;
		ControlSource = "gnTemp", ;
		Height = 23, ;
		Left = 116, ;
		Top = 24, ;
		Width = 100, ;
		Name = "Text1"


	ADD OBJECT label1 AS label WITH ;
		Caption = "gnTemp Value", ;
		Height = 17, ;
		Left = 118, ;
		Top = 7, ;
		Width = 82, ;
		Name = "Label1"


	ADD OBJECT label2 AS label WITH ;
		Caption = "Change gnTemp ", ;
		Height = 17, ;
		Left = 7, ;
		Top = 7, ;
		Width = 98, ;
		Name = "Label2"


	PROCEDURE Load
		PUBLIC gnTemp
		gnTemp = 0.0
		CREATE CURSOR temp1 (n1 N(5,2), c1 C(5) )
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"zero") 
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"one") 
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"two")
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"three") 
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"four") 
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"five")
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"six")
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"seven") 
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"eight") 
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"nine")
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"ten")
		INSERT INTO temp1 (n1, c1) VALUES (RECCOUNT('Temp1'),"eleven")
	ENDPROC


	PROCEDURE combo1.Valid
		THIS.Parent.Text1.Refresh()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
There is a known issue with using property controlsources with boundto integer combos, but this doesn't seem to be related. You can see this problem just by changing the indicated line.
Previous
Reply
Map
View

Click here to load this message in the networking platform