Need headings in listbox to become rows in another listbox

D

David

I need the column headings in a listbox to become the rows in another listbox so I can set up a sorting specification window. How do I do this?
 
J

Jonathan Parminter

Hi David,

the headings of a listbox are columns of the first row

Luck
Jonathan
-----Original Message-----
I need the column headings in a listbox to become the
rows in another listbox so I can set up a sorting
specification window. How do I do this?
 
F

fredg

I need the column headings in a listbox to become the rows in another listbox so I can set up a sorting specification window. How do I do this?

Use a Combo Box.
Set the Row Source Type to Field List.
Set the Row Source to the query name.
 
J

Jonathan Parminter

Hi david,

he's a code example:

Private Sub Form_Load()
Dim strFields As String
Dim intCol As Integer

With List0
For intCol = 0 To .ColumnCount - 1
strFields = strFields & .Column(intCol, 0)
& ";"
Next intCol
End With

If Len(strFields) > 0 Then
' remove extra semicolon
strFields = Left(strFields, Len(strFields) - 1)
End If

Combo2.RowSource = strFields
' rowsource is set to value list
End Sub


Luck
Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top