Using external Data in a qry

U

UnderSeven

Hi, I'm using Access 2003

I'm running a qry as part of a form which I want to use external data with
the WHERE clause, which would be gathered from a selection on a combo box on
the same form, this would then use the qry to populate a list box. I'm
pretty sure this is something I need to do in VB, but I'm not sure what.
Thanks.
 
P

Pat Hartman \(MVP\)

Use the parameter query as the RowSource for the listbox. You don't need
any VB. Unlike VB, Access listboxes and combos are bound and do not need to
be (although they can be) filled by a code loop.
 
U

UnderSeven

So far I'm with you, but the part I'm not figuring out is how to grab the
selection from the Combobox to use as a parameter for the qry which populates
the listbox.
 
J

John W. Vinson

So far I'm with you, but the part I'm not figuring out is how to grab the
selection from the Combobox to use as a parameter for the qry which populates
the listbox.

Create a stored Query with a criterion like

=[Forms]![NameOfForm]![NameOfFirstCombo]

and base the listbox on this Query.

You'll need to Requery the listbox in the AfterUpdate event of the
combo box.

John W. Vinson [MVP]
 

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