2

I am toying with Base but am stuck on how to set the ListSource of a ListBox with an array of values rather than data from a query.

Any help would be appreciated.

reg1965
  • 147
  • 3
  • 8

1 Answers1

2

To add entries manually, edit the form and create a new list box. Right-click on the control and choose Control. At General tab of control properties window, edit List entries property: add the first item, press Shift+Enter, and then add another item.

From How to Programmatically add or remove items in ListBox FORM control, @Lyrl writes:

The listbox array content is clunky; it's actually easier to work with if the form is connected to a Base file and the listbox content is determined by an SQL string.

That page also shows macro code to populate the list with an array of values.

oListBox.StringItemList() = Array("One", "Two", "Three")

Anton Samsonov
  • 1,380
  • 17
  • 34
Jim K
  • 12,824
  • 2
  • 22
  • 51