Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox Display
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00952729
Message ID:
00952744
Views:
12
Hi Russell,

ListBox controls don't have a drop down portion. Are you referring to ComboBox controls with their Style property set to 2 (which is a "drop-down list", disallowing entering new items into the ComboBox) ??

Assuming that you are...what I might try is, when your SQL statement creates its cursor, building another field that is a concatenation of ID and name (something like "1001 - MyFirstValue") as the first column of your cursor, thereby displaying that field in the ComboBox. Then, by using the BoundColumn and BoundTo properties of the ComboBox, you can return the exact value you're looking for from one of the other two columns. If you want to get REALLY fancy, you can build *two* queries that show the data in opposing order (ID and name, name and ID), provide a way that selects which order they view the entries, and re-run the corresponding query to display the items in the desired order based on their choice. This has the added benefit of allowing your users to utilize the "incremental search" capability whether they were typing an ID or a name.

>I have a listbox that is populated with a SQL statement/cursor. The cursor contains the following two fields: name and id. What I would like is for the "name" to appear in the dropdown portion of the listbox and then have the "id" appear in the listbox when a name is selected. Is this possible? If so, how?
>
>Thanks in advance!
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform