Distribute field value into a listbox in 2 or 3 columns (1 Viewer)

gbil

Registered User.
Local time
Yesterday, 20:04
Joined
Aug 30, 2013
Messages
26
Hello.

i want to display a single field values in list box with query as row source.

the query will produce variable number of records or rows. sometime 1, sometimes 3 or 6

my thought is to distribute these records/row into list box column. for example:

if query = 1 then listbox column = 1

if query = 6 then listbox column = 3 (two rows per column).

is this possible?
 

DavidAtWork

Registered User.
Local time
Today, 04:04
Joined
Oct 25, 2011
Messages
699
what is it that determines the rowsource for the list box. If there are conditions you can test to determine the rowsource, it is possible to set the properties for the listbox using vba like this:

Code:
If condition1 = True Then
    Me.Listbox1.RowSource = "query1Name"
    Me.Listbox1.ColumnCount = 1
    Me.Listbox1.ColumnWidths = "10 cm"
    Else
         Me.Listbox1.RowSource = "query2Name"
         Me.Listbox1.ColumnCount = 3
         Me.Listbox1.ColumnWidths = "6 cm;5 cm;6 cm"
 End If

David
 

Users who are viewing this thread

Top Bottom