Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dumbass Attack: using pulldownlists to populate a form..
Message
De
08/09/1998 13:22:36
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00131077
Message ID:
00134141
Vues:
13
I created a runnable (I hope) form for you to see one way a cbo can interact with data. There are many variations possible. From your postings it doesn't sound to me like you really want a SQL select. Even if you really do, I suggest that you start out with an alias rowsource. JMO that it's easier in getting started.

I will email it to you. For now here is the code from the class browser:
**************************************************
*-- Form:         form1 (e:\jobs\motorola\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*
DEFINE CLASS form1 AS form


	Top = 0
	Left = 0
	Height = 108
	Width = 279
	DoCreate = .T.
	Caption = "Form1"
	Name = "FORM1"


	ADD OBJECT stddate1 AS textbox WITH ;
		ControlSource = "MyClients.Id", ;
		Left = 144, ;
		Top = 12, ;
		Name = "Stddate1"


	ADD OBJECT stddate2 AS textbox WITH ;
		ControlSource = "MyClients.First_name", ;
		Left = 144, ;
		Top = 48, ;
		Name = "Stddate2"


	ADD OBJECT stddate3 AS textbox WITH ;
		ControlSource = "MyClients.Last_name", ;
		Left = 144, ;
		Top = 84, ;
		Name = "Stddate3"


	ADD OBJECT text4 AS textbox WITH ;
		ControlSource = "whopicked.clientid", ;
		Left = 12, ;
		Top = 48, ;
		Name = "Text4"


	ADD OBJECT stdcombobox1 AS combobox WITH ;
		BoundColumn = 2, ;
		ColumnCount = 2, ;
		ColumnWidths = "150,0", ;
		RowSourceType = 2, ;
		RowSource = "myclients.last_name,id", ;
		ControlSource = "whopicked.clientid", ;
		Height = 24, ;
		Left = 12, ;
		Top = 12, ;
		Width = 100, ;
		BoundTo = .T., ;
		Name = "Stdcombobox1"


	PROCEDURE Load
		CREATE CURSOR Whopicked (clientid n(1))
		APPEND BLANK
		GO TOP

		CREATE CURSOR myClients (id n(1), first_name C(20), last_name C(20))
		INSERT INTO myClients (id, first_name, Last_name ) VALUES (1, 'Alberta', 'Smith' )
		INSERT INTO myClients (id, first_name, Last_name ) VALUES (2, 'Dryfus', 'Borweeng' )
		INSERT INTO myClients (id, first_name, Last_name ) VALUES (3, 'Goon', 'Lupine' )
		INSERT INTO myClients (id, first_name, Last_name ) VALUES (4, 'Girth', 'Brooks' )
		INSERT INTO myClients (id, first_name, Last_name ) VALUES (5, 'John', 'Elway' )


		GO TOP
	ENDPROC


	PROCEDURE stdcombobox1.Valid
		THISFORM.REFRESH
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform