Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need some Help with a combo
Message
From
12/12/2001 15:16:03
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00593462
Message ID:
00593494
Views:
32
Actually not similar to your solution. If you're doing a complete reselection of SQL what the requery() is for ? I'd simply assign SQL once in init and requery() when params changes. You could also do an index in init once and only requery()+seek in ChangeTown.
Cetin


>Thanks, Cetin. It's similar to my solution: (do you think, it would be better without using index on and seek?)
>At the end of ChangeTown method:
>
>with this.cboSelTowns
>     .RowSource = ''
>     .RowSource = m.lcSelect
>     .requery()
>	lnSelect = select()
>	select curSwitchTowns
>	index on town tag town
>	seek m.tcTown
>	.ListIndex = recno()
>	select (m.lnSelect)
>endwith
>
>>>Hi everybody,
>>>
>>>I have a combobox in a container class. Here is Container.ChangeTown method:
>>>
>>>lparameter tcState, tcTown
>>>local lcState, lcSelect, lcTown
>>>if vartype(m.tcState)<>"C"
>>>   lcState=''
>>>else
>>>   lcState = m.tcState
>>>endif
>>>if vartype(m.tcTown)<>"C"
>>>   lcTown=''
>>>else
>>>   lcTown = m.tcTown
>>>endif
>>>lcSelect=[select towns.fullname as city, towns.State, ] + ;
>>>         [towns.ccode, postregn.joiningtwn as Town ] + ;
>>>         [from postregn, towns where postregn.joiningtwn = towns.town ] + ;
>>>         [and postregn.town = '] + m.lcTown + [' ] + ;
>>>         [union select towns.FullName as city, Towns.State, ] + ;
>>>         [Towns.ccode, Towns.town from Towns ] + ;
>>>         [where town='] + m.lcTown + [' ] + ;
>>>         [union select padr('< blank >',20) as city, space(2) as State, ] + ;
>>>         [space(2) as ccode, space(4) as town from Towns ] + ;
>>>         [where town='ACTO' ] + ;
>>>         [into cursor curSwitchTowns order by 1]
>>>with this.cboSelTowns
>>>     .RowSource = ''
>>>     .RowSource = m.lcSelect
>>>     .requery()
>>>endwith
>>>
>>>I'd like my combo to show passed town in DisplayValue (I actually pass Town, but the first field is City). How can I do it?
>>>
>>>Combo is not bound and should not be. It has empty ControlSource.
>>>
>>>Thanks a lot in advance.
>>
>>-Move town to first position
>>*Init
>>.Rowsourcetype = 3
>>.Rowsource=m.lcSelect
>>
>>*ChangeTown
>>Select curSwitchTowns
>>locate for town=m.lcTown
>>
>>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
Next
Reply
Map
View

Click here to load this message in the networking platform