Welcome! Log In Create A New Profile


[WB24]Changing Displayed Item in Combo

Posted by ericus 
[WB24]Changing Displayed Item in Combo
January 20, 2020 08:59PM
Good day

I have a combo displaying the result of a query sorted by description.

I have a button that allows the sort to be by Code.

I use this code:

COMBO_VendorFrom..BrowsedFile = ""
COMBO_VendorFrom..DisplayedItem = ":QRY_Vendors.VCode"
COMBO_VendorFrom..StoredItem = ":QRY_Vendors.VendorCode"
COMBO_VendorFrom..BrowsedFile = ":QRY_Vendors"

But the combo list is empty after the code above is run.

When I do the same, displaying the data from an array, it works 100% but not from a query.

The help says it is best to:

1.Stop the browse by assigning an empty string ("") to ..BrowsedFile.
2.Modify the relevant properties.
3.Restart the browse with ..BrowsedFile.

Any ideas please.

Thanks in advance

Ericus Steyn
Re: [WB24]Changing Displayed Item in Combo
January 21, 2020 06:56AM
Hi ericus,

As I can see, the query is prefixed with :

Try thi code:

COMBO_VendorFrom..BrowsedFile = "QRY_Vendors"
COMBO_VendorFrom..DisplayedItem = "VCode"
COMBO_VendorFrom..StoredItem = "VendorCode"
ListDisplay(COMBO_VendorFrom) or use the newer syntax: COMBO_VendorFrom.Display()

If the combo box is initialised with parameters, then user COMBO_VendorFrom.Display(taInit)

I hope to help.


Vassilis Boutsikas

Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.