Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best approach for listbox on values
Message
From
26/07/2001 14:23:06
 
 
To
26/07/2001 14:16:41
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00529536
Message ID:
00535944
Views:
46
>>>>I am wondering what is the best approach to take when we have a listbox of type 1 - Value where we enter our own values in RowSourceType property. It's not like a listbox of type 3 - SQL where we can bound the control source to field on BoundColumn 2. Basically, what is the best approach to bound the control source when entering the values manually at the form designer level?
>>>
>>>Nothing should change here. It doesn't matter, what's the RowSourceType property for the combo.
>>
>>It matters as the values entered manually are not the values which goes in the table. In a listbox of type 3 - SQL, where we could have SELECT DESCRIPTION,PRIMARYKEY FROM PIVOT ORDER BY 1 INTO CURSOR TEMP, we can have a BoundColumn to 2. So, the PrimaryKey value will be saved.
>>
>>When entering the values manually, such as MyValue1,MyValue2 with a listbox of type 1 - Value, there is no direct approach of having an automatic relationship with the value we would save. For example, we have a full description 1 and a full description 2. But, we only save a small description 1 and a small description 2.
>
>
>michel -
>
>i see this is an old thread, and you may well have gotten your answer by
>now, but i didn't see a complete answer to your actual question, so ...
>
>if you specify 1-Value for rowsource type for a listbox, you can
>include a code that corresponds to the description that you actually
>display to the user. you can also hide or display the code, as you
>wish.
>
>your row source could look like this:
>
>1,Apple,2,Pear,3,Orange,4,Banana
>
>set column-count = 2
>set bound-column = 1
>set column-widths = 20,100
>
>your listbox will look like
>
>
>1 Apple
>2 Pear
>3 Orange
>4 Banana
>
>
>'value' of Orange will be 3.
>
>(or of course you could use a "short description" instead of a number).
>
>to hide the first column,
>set column-widths = 0,100

Thanks Patrick but I ended up to continue to use the same approach as from a cursor by defining that cursor in the Init() of the form.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform