Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox displayvalue shows a blank
Message
From
17/03/2004 03:18:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00886972
Message ID:
00886975
Views:
18
>Hi,
>Is there a way to get the combobox.displayvalue (a character value)to show the combobox.value despite the combobox.controlsource value is not spelt the same?
>For example: combobox.controlsource is set to tableA.field1. The rowsource is set to tableB.field1. If a name in tableA.field1 is spelt like "Ann Oswald" and in tableB.field1 spelt like "Ann OSWALD" the combobox.displayvalue shows "" and the combobox.value is "Ann OSWALD", i.e. the combo display is blank. If the name is spelt the same way in both tables, ie tableA.field1=tableB.field1="Ann Oswald" the combobox.displayvalue="Ann Oswald"

Anders,
You might union the controlsource table with combo source table. Then it'd have all the values.
Alternatively you might leave the controlsource empty and use an SQL rowsource where it has upper() or lower() names in a column. ie:
*Combo.init
with this
 .RowSourceType = 3
 .RowSource = 'select myName, upper(myName) as myMatch'+;+
    ' from names into cursor crsNames'
 .ColumnCount = 1
endwith

*Combo.Valid
replace mySource.myName with crsNames.myName in 'mySource'

*Whereever record pointer moves
select crsNames
locate for myMatch = upper(mySource.myName)
OTOH if lookup and source tables had the relation via some other field like a PKID this wouldn't be a problem at all.
PS: If name changing back to Ann Oswald wouldn't be a problem you might simply search in combo rowsource.
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