Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple Column Combobox
Message
From
02/12/2002 16:32:54
 
 
To
02/12/2002 15:22:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00728750
Message ID:
00728789
Views:
14
Hi Joe,

I think Yuri must have misunderstood your last question and, although I could be wrong, the combobox value property should probably contain 0 (zero). Here is what we do when we want a combo box based on an array:

First, the combobox must be able to "see" the array so we establish a form property such as laComboArray[1]. You dimension the array later, probably in the form Load method. When you set up the array values, make sure you are actually assigning values to THISFORM.lacomboarray[1,1] etc and NOT simply laComboArray[1,1] (I have made this mistake!!). You are correct in that column one of the array should contain the values you want displayed and column two should contain what you want stored.

Then, on the property sheet for the combobox, set the following settings,
boundcolumn = 2, boundto = .T., controlsource = THE FIELD WHERE YOU WANT THE DATA STORED, rowsourcetype = 5-Array , rowsource = THISFORM.laComboArray (Don't forget the THISFORM) and value = 0. (Just a reminder, your actual array name can be of your choosing not necessarily laComboArray)

Hope this helps,

Ken

>What exactly is stored in the Combobox Value property? The name of the field where I want the data to go? Or the name of the source the data is coming from? If it is where the data is coming from, then I am pulling it from an array...and what the user selects should be what is stored.
>
>
>
>>How do you define it? May be you omit table_name? It should be "table_name.field_name".
>>
>>>I'm sorry...it is a field in a table.
>>>
>>>>What do youn mean,"controlsource table "? AFAIK, Controlsource is a variable or field.
>>>>
>>>>
>>>>>I have created a new combobox on an existing form and am having problems getting it setup properly. The rowsourcetype is 5 - Array and the rowsource is the arrayname. The array has two columns: column 1 is a list of the values that I would like the user to see, column 2 is number values that I would like saved in the controlsource table. The way that I have it setup right now the combobox is not showing anything. And what do I need to do so that the second column is stored in the controlsource table (right now I have value = array(1))
>>>>>
>>>>>Also, I have Columncount = 2; Columnwidths = 100,0; Boundcolumn = 1.
>>>>>
>>>>>Please help!!
Previous
Reply
Map
View

Click here to load this message in the networking platform