Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: List Box Rowsource = RecordSource

62 views
Skip to first unread message

'69 Camaro

unread,
Sep 15, 2005, 5:13:07 AM9/15/05
to
Hi.

> How would I go about setting a list box rowsource to equal that of the
> [form's RecordSource], including a filtered [RecordSource]

Try:

If (Len(Me.Filter) > 0) Then
Me!lstList.RowSource = "SELECT * " & _
"FROM " & Me.RecordSource & _
" WHERE " & Me.Filter
Else
Me!lstList.RowSource = Me.RecordSource
End If

Me!lstList.Requery

... where lstList is the name of the list box. You may have to set the list
box's Bound Column, Column Count, Column Widths, et cetera, Properties to
match the form's RecordSource column information and other list box
information so that the correct column(s) will be displayed in the list box.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


"Murp" wrote:

> How would I go about setting a list box rowsource to equal that of the
> rowsource, including a filtered rowsource?
>
> --
> Yo Yo Ma.

0 new messages