Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box display 1

Status
Not open for further replies.

LenaS

Technical User
Nov 28, 2000
98
US
Turned on wizard and created combo box. Entered the following:
1. List Items: selected fields :DEV and DEVDESC from table DEVCODE.
2.Style: 3d and drop down combo
3. Layout : displays both selected columns from list items and none were hidden
4. Value: Value returned from DEV and field to store value is Claims.dev.

When I run the form The combo box only displays the DEV field but on drop down it shows both DEV and DEVDESC. How do I get both fields to show on form before drop down? The field is updating the other file correctly, but would simply like to see both on the form before dropdown.
 
That’s the behavior of a combo box. A combobox is designed to bind to a field and when the arrow is clicked show you the other possible values that could have been picked and show extra columns that better describe the item picked.

if you want to show the "extra" info create a text box adjacent to the combo box and in the interactive change event of the combo box set the value of text box.

I hope this helps.
 
Hi, LenaS!

To do that, you require to make some workaround because VFP have no such ability by design.

First of all, make a query that will return 3 fields:

DEV + DEVDESC (to display), DEV and DEVDESC.

In the combobox show all fields, but make following adjustments of properties:

BoundColumn = 2 (to bind ControlSource field to the DEV field values in combobox)
ColumnCount = 3
ColumnWidths = 0,100,100 && csample only - to do not display DEV + DEVDESC in the drop-down list).

This way DEV + DEVDESC will display in combobox, but when user selects somthing, these values will be separated to the two columns.

You can also make it look better, for exmple, using:
allt(DEV) + ', ' + DEVDESC,
this way it will look in combobox like following:
'DEV1, Primary'




Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
I had been searching for a solution to show both columns in the selected box. Finally found one. Thanks Vlad.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top