Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passed variable from combobox 2 listbox
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00901793
Message ID:
00901857
Views:
15
>Hello,

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

>mycombox: with items
>AA
>BB
>CC

>and how to add to mylistbox: to have ???

>AA
>BB
>CC

Hi,

It depends how you want to pass the variables, is it your combo box & list box control on the same form? If yes..

Try to use this...

In your form's activate procedure you can put this code:

WITH thisform
.cbosalutation.AddItem("Car Rental")
.cbosalutation.AddItem("Hotel")
.cbosalutation.AddItem("Airport Service")
ENDWITH

You can also set the row source to a table if you want...

Then under the valid procedure of your combo box, you put this code:

cItem = ALLTRIM(this.value)
With thisform
IF !EMPTY(cItem)
.list1.AddItem(cItem)
.list1.Requery()
ENDIF

You have to add some validation to check if a selected item is already in your list, otherwise it will have duplicates.

hope can help.



Jojo R. dela Cuesta
Dalplus Technologies
http://www.dalplus.com
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Previous
Reply
Map
View

Click here to load this message in the networking platform