Set Combobox to null?

Hi Folks - this seems trivial but I must have missed a poit?

I have a combo box, based on a value list which will accept an empty value, and is editable.

I want to clear any entry in the box using code and thought all I had to do was:

forms.frm_quick_filter_tab.elements.fld_search_analysiscd = null

or

forms.frm_quick_filter_tab.elements.fld_search_analysiscd.text = null

These fields are empty on opening and are populated by a user. Neither of the above are supported so how can I delete the current entries?

Appreciate you feeding the dumbo once again… :oops:

Hi Kahuna,

What if you set the dataprovider to null or “” instead of the form field itself ?

ROCLASI:
Hi Kahuna,

What if you set the dataprovider to null or “” instead of the form field itself ?

The dataprovider is already set to none Robert - this is just a search form where the user has the combo drop down to select a value then I run a filter based on that entry (or I would if I could get / set the entry programatically.

Did I miss your point Robert? I cant see any methods I can apply or properties I can check that will allow me to get/set the field content and if the dataprovider is already ‘none’ I’m not sure how to interact with the field?

  1. “Editable” for a combobox means that users can type in a value, you don’t want that → uncheck editable.
  2. You need to set a dataprovider to interact with the field. If your field has a dataprovider and you set the dataprovider to null as Roclasi said, then your combobox won’t show anything.

Does this make things clear?

Joas:

  1. “Editable” for a combobox means that users can type in a value, you don’t want that → uncheck editable.
  2. You need to set a dataprovider to interact with the field. If your field has a dataprovider and you set the dataprovider to null as Roclasi said, then your combobox won’t show anything.

Does this make things clear?

Thanks Joas - I need the combos to be editable because later I want the user to be able to not only select from the list buts also enter a more complex search string that I can parse to build SQL.

But you have put me on the right track I think.

I need to create a global data provider and then interact with the global (get the content - set the content).

Trying this just now - the field is not accepting the entry from the value list. I Created a global for the field - set to null - and attached that that global to the combo field as the dataprovider.

On the combo field I used the value list and selected an entry - the combo shows empty though - what am I missing Joas?

Kahuna:

Joas:

  1. “Editable” for a combobox means that users can type in a value, you don’t want that → uncheck editable.
  2. You need to set a dataprovider to interact with the field. If your field has a dataprovider and you set the dataprovider to null as Roclasi said, then your combobox won’t show anything.

Does this make things clear?

Thanks Joas - I need the combos to be editable because later I want the user to be able to not only select from the list buts also enter a more complex search string that I can parse to build SQL.

But you have put me on the right track I think.

I need to create a global data provider and then interact with the global (get the content - set the content).

Trying this just now - the field is not accepting the entry from the value list. I Created a global for the field - set to null - and attached that that global to the combo field as the dataprovider.

On the combo field I used the value list and selected an entry - the combo shows empty though - what am I missing Joas?

Please Ignore the above Joas - I needed to close Developer completely and to reopen to get this functionality to work! But it does work - thanks all.