Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passed variable from combobox 2 listbox
Message
From
07/05/2004 07:18:49
 
 
To
06/05/2004 20:16:55
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00901793
Message ID:
00901873
Views:
13
Hi PAul.

myform.scx contains mycombox with a variable to pass to mylistbox,I means
select 1 item from mycombox and add to mylistbox:


The simple answer is something similar to this in the combo box's Valid():
Thisform.MyListBox.AddItem( This.List[ This.ListIndex ] )
This works for a RowSourceType of 0-None. If your list box has a RowSourceType of 2-Alias or 6-Fields, you need code like this instead:
INSERT INTO < ListBox Alias > ( < Field NAme > ) VALUES ( This.Value )
Thisform.MyListBox.Requery()
And if the list box has a RowSourceType of array, you would add the combo box's value to the array and REQUERY() the list box.

But there are other issues here to. Do you want to be able to add the same item from the combo box to the list box over and over again? Or should you remove the item from the ombo box after it has been added to the listbox? If this is the case, maybe you need a mover list instead. You can take a look at the mover list that ships with the VFP foundation classes.
Previous
Reply
Map
View

Click here to load this message in the networking platform