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
Title:
ComboBox with when clause issues
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01058638
Message ID:
01058638
Views:
56
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.
Next
Reply
Map
View

Click here to load this message in the networking platform