Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox
Message
De
19/07/2002 13:06:31
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00680373
Message ID:
00680533
Vues:
18
Ria,

I was a bit puzzled and did a test

I've got a form with two combo's

Combo1 has RowSourceType = 1 and RowSource = 'A,B'
The following code goes into Combo1.InteractiveChange and it seems like it does what I want it to do
do case
case this.Value = 'A'
	this.Parent.Combo2.RowSource = 'Employee.emp_Id'
	this.Parent.Combo2.RowSourceType = 6

case this.Value = 'B'
	this.Parent.Combo2.RowSource = 'Group.gr_Id'
	this.Parent.Combo2.RowSourceType = 6
otherwise
	assert FALSE
endcase

this.Parent.Combo2.Style = 2
=this.Parent.Combo2.Requery()

go top in (left(this.Parent.Combo2.RowSource, at('.',this.Parent.Combo2.RowSource)-1))
this.Parent.Combo2.Value = eval(this.Parent.Combo2.RowSource)
>I couldn't get it to work that way. But the code below works.
>
>Ria
>
>ComboboxB - RowsourceType = 1(Value)
>
>ComboBoxA - Interactive Change
>
>
>thisform.comboboxB.clear
>do case
>case this.text = "A"
> select TableA
> go top
> do while not eof()
> thisform.comboboxB.additem(TableA.Field1)
> skip 1
> enddo
>case this.text = "B"
> select TableA
> go top
> do while not eof()
> thisform.comboboxB.additem(TableB.Field1)
> skip 1
> enddo
>endcase
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform