Is there a problem setting ControlSource to listboxes?

The code below doesn´t work. It selects the first field in the local view
vwAccActs as its source. Accesscode is the second field.

ThisForm.List2.ColumnCount = 1
ThisForm.List2.RowSourceType = 2
ThisForm.List2.RowSource = 'vwAccActs'
ThisForm.List2.ControlSource = 'vwAccActs.accesscode'

But if the same listbox is called with anothter code (below) it works just
fine.

ThisForm.List2.ColumnCount = 1
ThisForm.List2.RowSourceType = 2
ThisForm.List2.RowSource = 'VwAccGrps'
ThisForm.List2.ControlSource = 'VwAccGrps.accesscode' && accesscode is the
second field

I need a hint please.

Best regards
Chrisitna

Re: Listboxes ControlSource VFP8 SP1 VISTA by Rush

Rush
Mon Mar 24 16:23:15 CDT 2008

Christina wrote:
> Is there a problem setting ControlSource to listboxes?
>
> The code below doesn´t work. It selects the first field in the local
> view vwAccActs as its source. Accesscode is the second field.
>
> ThisForm.List2.ColumnCount = 1
> ThisForm.List2.RowSourceType = 2
> ThisForm.List2.RowSource = 'vwAccActs'
> ThisForm.List2.ControlSource = 'vwAccActs.accesscode'
>
> But if the same listbox is called with anothter code (below) it works
> just fine.
>
> ThisForm.List2.ColumnCount = 1
> ThisForm.List2.RowSourceType = 2
> ThisForm.List2.RowSource = 'VwAccGrps'
> ThisForm.List2.ControlSource = 'VwAccGrps.accesscode' && accesscode is
> the second field
>
> I need a hint please.
>
> Best regards
> Chrisitna

Did you change your ThisForm.List2.BoundColumn property?

- Rush

Re: Listboxes ControlSource VFP8 SP1 VISTA by Christina

Christina
Mon Mar 24 17:06:57 CDT 2008

Hi Rush!

No I didn´t chanfe the BoundColumn property. In both cases BoundColumn is
default 1, BoundTo is .default F., ColumnCount = 1

Christina

"Rush Strong" <rpstrong@gmail.com> skrev i meddelandet
news:7ZUFj.2275$Xl2.1527@trndny01...
> Christina wrote:
>> Is there a problem setting ControlSource to listboxes?
>>
>> The code below doesn´t work. It selects the first field in the local view
>> vwAccActs as its source. Accesscode is the second field.
>>
>> ThisForm.List2.ColumnCount = 1
>> ThisForm.List2.RowSourceType = 2
>> ThisForm.List2.RowSource = 'vwAccActs'
>> ThisForm.List2.ControlSource = 'vwAccActs.accesscode'
>>
>> But if the same listbox is called with anothter code (below) it works
>> just fine.
>>
>> ThisForm.List2.ColumnCount = 1
>> ThisForm.List2.RowSourceType = 2
>> ThisForm.List2.RowSource = 'VwAccGrps'
>> ThisForm.List2.ControlSource = 'VwAccGrps.accesscode' && accesscode is
>> the second field
>>
>> I need a hint please.
>>
>> Best regards
>> Chrisitna
>
> Did you change your ThisForm.List2.BoundColumn property?
>
> - Rush


Re: Listboxes ControlSource VFP8 SP1 VISTA by Anders

Anders
Mon Mar 24 18:19:11 CDT 2008

If acccesscode is numeric then BoundTo should be .T.
-Anders

"Christina" <ch.lofberg@eurosoft-se.com> wrote in message
news:A211F5A6-A71B-401F-9651-F0AB826A6F6D@microsoft.com...
> Hi Rush!
>
> No I didn´t chanfe the BoundColumn property. In both cases BoundColumn is
> default 1, BoundTo is .default F., ColumnCount = 1
>
> Christina
>
> "Rush Strong" <rpstrong@gmail.com> skrev i meddelandet
> news:7ZUFj.2275$Xl2.1527@trndny01...
>> Christina wrote:
>>> Is there a problem setting ControlSource to listboxes?
>>>
>>> The code below doesn´t work. It selects the first field in the local
>>> view vwAccActs as its source. Accesscode is the second field.
>>>
>>> ThisForm.List2.ColumnCount = 1
>>> ThisForm.List2.RowSourceType = 2
>>> ThisForm.List2.RowSource = 'vwAccActs'
>>> ThisForm.List2.ControlSource = 'vwAccActs.accesscode'
>>>
>>> But if the same listbox is called with anothter code (below) it works
>>> just fine.
>>>
>>> ThisForm.List2.ColumnCount = 1
>>> ThisForm.List2.RowSourceType = 2
>>> ThisForm.List2.RowSource = 'VwAccGrps'
>>> ThisForm.List2.ControlSource = 'VwAccGrps.accesscode' && accesscode is
>>> the second field
>>>
>>> I need a hint please.
>>>
>>> Best regards
>>> Chrisitna
>>
>> Did you change your ThisForm.List2.BoundColumn property?
>>
>> - Rush
>



Re: Listboxes ControlSource VFP8 SP1 VISTA by Christina

Christina
Mon Mar 24 19:06:55 CDT 2008

Hi Anders!
acccesscode is character in both cases..
Christina

"Anders Altberg" <anders.altberg> skrev i meddelandet
news:%23UpK7agjIHA.4244@TK2MSFTNGP06.phx.gbl...
> If acccesscode is numeric then BoundTo should be .T.
> -Anders
>
> "Christina" <ch.lofberg@eurosoft-se.com> wrote in message
> news:A211F5A6-A71B-401F-9651-F0AB826A6F6D@microsoft.com...
>> Hi Rush!
>>
>> No I didn´t chanfe the BoundColumn property. In both cases BoundColumn is
>> default 1, BoundTo is .default F., ColumnCount = 1
>>
>> Christina
>>
>> "Rush Strong" <rpstrong@gmail.com> skrev i meddelandet
>> news:7ZUFj.2275$Xl2.1527@trndny01...
>>> Christina wrote:
>>>> Is there a problem setting ControlSource to listboxes?
>>>>
>>>> The code below doesn´t work. It selects the first field in the local
>>>> view vwAccActs as its source. Accesscode is the second field.
>>>>
>>>> ThisForm.List2.ColumnCount = 1
>>>> ThisForm.List2.RowSourceType = 2
>>>> ThisForm.List2.RowSource = 'vwAccActs'
>>>> ThisForm.List2.ControlSource = 'vwAccActs.accesscode'
>>>>
>>>> But if the same listbox is called with anothter code (below) it works
>>>> just fine.
>>>>
>>>> ThisForm.List2.ColumnCount = 1
>>>> ThisForm.List2.RowSourceType = 2
>>>> ThisForm.List2.RowSource = 'VwAccGrps'
>>>> ThisForm.List2.ControlSource = 'VwAccGrps.accesscode' && accesscode is
>>>> the second field
>>>>
>>>> I need a hint please.
>>>>
>>>> Best regards
>>>> Chrisitna
>>>
>>> Did you change your ThisForm.List2.BoundColumn property?
>>>
>>> - Rush
>>
>
>