Using a query against a listbox having a Where as argument

H

H. Martins

I have a form in which I can browse through records. That form has a
listbox. That listbox has no RowSource and no ControlSource defined
(don't need this last).

Using VBA I make the RowSource string manipulating the usual SQL
statement but modifying the WHERE part of it when needed. Then I use
ListBox.ControlSource = string

It works OK, but I suppose this is not the most clever way to do it.

I suppose there must be a way I can create a Query (project manager ->
queries) and use it against the listbox adding a Where statement to
it and launching listbox.requery, something like this but with the
listbox:

DoCmd.OpenForm "Alunos", , , strWhereCondition

Could I have some help. please?

Thanks
Henry
 

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