Dynamic default values in listboxes?

Dynamic default values in listboxes
Hi, picked up a lot of info on listboxes, how to s, however still stuck with a possibly minor issue.
In an Asset management db a form has multiple listboxes to select location, owner, colour, insurance etc…
In order to make the data entry process less painful I would like the list boxes first of all to display a default aka “Unallocated” for every new record and once the selection changes the last selection should become the new default.

Options I am tossing around are to modify Arinekaigs clone field macro (eliminating the keys and run from lb event)
https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=83531

or modify the SetNewSelection(oListBox as Object, iLastSelection as Integer) macro found in the Tools Library or find a way to manipulate the Default Selection property.
I am just wondering whats the most elegant way to go about this one, thanks for your interest.

Hello,

I don’t think there is an “elegant” way to do this. Have been using my own version of SetNewSelection in my personal system. This is used to determine which value in the list is equal to the current month/year or the closest previous one. This then displays the related data on form opening. Of course, once the form is opened, can change the selection.

Best advice I can offer is to avoid macros whenever possible. You need to balance the scale between making the users life easy or future maintenance of the system.

Unfortunately I don’t follow my own advice :slight_smile:

Thks for responding, yep its that balancing between must have, should have, could have…