Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cant get a ComboBox to select correct records
Message
 
To
27/04/2002 09:35:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00649961
Message ID:
00649996
Views:
15
Cetin, I did waht you suggested , but with no luck.
I then moved code to the Valid of MyStkGrp which DID work e.g.
This.Parent.cboStock,Rowsource = 'Select * from.......'

I dont understand why this is necessary. On the same form, I have another combo box which works perfectly without having to resort to this.

My other combo that works: Select * from MyFile Where Myfield = 'XXX'

The only differencr I can see from the two combos is :

On the combo that did not work, the select field was depending on data entered on the form (i.e. MyStkGrp.Value)

On the Combo that was ok, there was no dependance
.i.e It was selecting based on a value ('XXX')

I also set up another form from scratch just to test out and I was able to replicate the problem.

Woild you have any idea why there is different behaviour for the two combos ?

Regards,

Gerard






>>Hi,
>>
>>I have a screen with a few fields as follows:
>>
>>Stock Group: MyStkGrp
>>Stock Lookup: CboStock
>>
>>The CboStock box has Row Source = 3 (Sql Select) and coded as follows:
>>
>>Select * from StockFil where StkGrp = This.Parent.MyStkGrp.Value
>>
>>... nothing is selected
>>
>>
>>I've used Combo Boxes before and had no problem. The only differencr I can see on this form is that the selection is based on another field on the form. Its as if Foxpro is not recognising the value inthe MyStkGrp field for the combo select.
>>
>>Is there something I'm doing wrong
>>
>>Thanks for your help
>>
>>regards,
>>
>>Gerard]
>
>Gerard,
>Style of using a field value on form also works.
>-Be sure you assign rowsource in a method (you should be since it didn't error) probably in combo's init.
>-Probably it's a char field. Use trim :
>... where StkGrp = trim(This.Parent.MyStkGrp.Value) ...
>-Also be sure you have a destination in rowsource. ie :
>..into cursor crsStokGrp
>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform