Combo box behaviour in a Base form

Hello everyone,

Just to keep it simple, assume a table control on a form with a single combo box column, which is linked to a table column. As one starts entering the data, the rows already inserted into the table are available to be reutilized for next entries, without typing. However, if I erase one of the previous rows (and that particular item was NOT repeated), then the data is still available for reutilization. Essentially it is not removed from the combo box properties. One can clearly see it in oEvt.Source.Model.StringItemList. Is this by design, or is this something that should be brought to the developer’s attention as an omittance?

Combo boxes and list boxes won’t be refreshed automatically.

How did you fill the combo box?

Did you set cursor in combo box and refresh the field?

Combo source:

SELECT DISTINCT "column name" FROM "table name" ORDER BY "column name"

Auto refresh subforms, list boxes and combo boxes: Apache OpenOffice Community Forum - [Base, Python] Tiny Macro Refreshing Forms, List/Combo Boxes - (View topic)

  1. Install the attached macro
  2. Add a hidden control named “AutoRefresh” to the same (sub-)form and enter the name of the combo box as value.
  3. Assign the macro to the form’s event “After record action”

From now on, the combo will be refreshed when you add a new string, when you modify an existing string and when you delete one.

No, I just pressed the arrow down at the next available row. It’s easy to get rid of this behavior if not desired. The purpose of my post was merely to point this particular detail out, in case it would be an aspect that the developers would like to address.

Amazing, I’ll look into this in detail a little bit later. Thank you Mr. Villeroy.

AutoRefresh_Combo_Box.odb (56.9 KB)

1 Like