Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Erasing a combobox's memory
Message
 
 
To
13/07/2005 16:44:34
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01032369
Message ID:
01032459
Views:
16
Elyse,

>I have that in there, too. Still doesn't work.

Look at this sample code. FWIW a long time ago I decided to put an array property on my lowest level cbo subclass and always use this array for it's droplist. For simplicity here in the test code the array is put on the form.
**************************************************
*-- Form:         form1 (c:\vfp8app\misc\elyse1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   07/13/05 07:30:14 PM
*
DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	cmode = "A"
	Name = "Form1"
	DIMENSION alist[1]

	ADD OBJECT opgmode AS optiongroup WITH ;
		ButtonCount = 2, ;
		Value = 1, ;
		Height = 46, ;
		Left = 22, ;
		Top = 32, ;
		Width = 71, ;
		Name = "opgMode", ;
		Option1.Caption = "A", ;
		Option1.Value = 1, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Top = 5, ;
		Option1.Width = 61, ;
		Option1.Name = "Option1", ;
		Option2.Caption = "B", ;
		Option2.Height = 17, ;
		Option2.Left = 5, ;
		Option2.Top = 24, ;
		Option2.Width = 61, ;
		Option2.Name = "Option2"


	ADD OBJECT cbotest AS combobox WITH ;
		RowSourceType = 5, ;
		RowSource = "thisform.aList", ;
		Height = 24, ;
		Left = 170, ;
		Top = 30, ;
		Width = 100, ;
		Name = "cboTest"

	PROCEDURE Load
		create cursor x1 ( mode c(1), cbovalue c(1) )

		insert into x1 values ( 'A', 'A' )
		insert into x1 values ( 'A', 'B' )
		insert into x1 values ( 'A', 'C' )
		insert into x1 values ( 'B', '1' )
		insert into x1 values ( 'B', '2' )
		insert into x1 values ( 'B', '3' )

		return dodefault()
	ENDPROC

	PROCEDURE Init
		this.cboTest.Requery() && initialize it
		return dodefault()
	ENDPROC

	PROCEDURE opgmode.InteractiveChange
		thisform.cMode = iif( this.Value = 1, 'A', 'B' )

		with thisform.cboTest
		   .Value = ""
		   .Requery()
		   .Refresh()
		endwith
		return dodefault()
	ENDPROC


	PROCEDURE cbotest.Requery
		select cbovalue ;
		   from x1 ;
		   into array thisform.aList ;
		   where mode = thisform.cMode ;
		   order by 1

		return dodefault()
	ENDPROC
ENDDEFINE
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform