Distribute field value into a listbox in 2 or 3 columns

gbil

Registered User.
Local time
Today, 13:05
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?
 
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

Back
Top Bottom