Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox with when clause issues
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01058638
Message ID:
01058695
Views:
14
Hello Terry,

No, the code that I'm placing in the .Where() event is supposed to be there. In other words, I defnitely want it to do that check before allowing the user access to the State/Province combo box.

I may have added confusion by listing the code in the .Where() event. It really is irrelavent other than the fact that if I put any code in the .Where() event, the control starts the odd behaviour of wiping out the text the user has entered (if they exit the combobox and reenter it).

Is that any clearer?

Rodd

>Rodd
>
>Can't really get my head round this. You sure the code shouldn't be in the .Valid() event, if you're reacting to user's input?
>
>Terry
>
>>I have a combo box with the following settings:
>>
>>.ControlSource = thisform.oAddrInfo.stprov
>>.Sorted = .T.
>>.Name = cboStProv
>>.Style = 0
>>.RowSource = "nwizprov.stprov"          && Table with alias of nwizprov
>>.RowSourceType = 6
>>.Format = '!'
>>.BoundColumn = 1
>>.ColumnCount = 1
>>
>>
>>This allows the user to add provinces into the table if they don't exist in our list. This part works great.
>>
>>However, if I add the following clause to the When method:
>>
return empty(this.parent.cboAddrId.Value)
>>I start getting this weird result. If the user enters something into cboStProv that does not exist in the list and then leaves the cboStProv control, when the user re-enters that control, the text they've entered gets wiped out.
>>
>>If I remove the when clause, the text they entered remains there.
>>
>>Any ideas as to what is going on and how to fix this? I need the when clause but I need the text to stay there as well.
>>
>>P.S. I do not add the text they entered to the list until they're done with that form.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform