Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo lookups
Message
From
06/11/2006 12:39:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/11/2006 12:19:19
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
01166441
Message ID:
01167356
Views:
8
>>>I've come across a combobox situation that is new to me and I would appreciate a brief tutorial. The function is basically a lookup. My difficulty is that I want to store one field and display another. The situation is this:
>>>
>>>Maintable1 has an integer field to store employeeID.
>>>The combo.controlsource is maintable1.employeeID.
>>>The combo is populated from lookuptable.employeename and lookuptable.employeeID.
>>>The combo will display the employeename both when it is open and when it is closed.
>>>
>>>Is this possible?
>>
>>The field you store is different from the field you show, right?
>>
>>List two columns in the ComboBox RowSource, but set the number of columns (i.e., visible columns) to 1. Set BoundColumn to 2, the invisible column.
>
>I thought I had this licked. I set it up as you suggested except I left both columns visible. This is the same way the builder did it. It seemed to work OK on the form. It displayed the names correctly and changed them Ok when the box was operated. Then I discovered that the value being stored is the wrong value. Even though the name displays right, the value stored into the table does not match the name ID. It appears the value being stored is the name's position in the dropdown list rather than the value in the second column. BoundColumn is set to 2. It works the same way with the cursor sorted or not sorted. Any more thoughts?

BoundTo = .t.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform