> Jim,
> You'll need a Where clause to criteria the query...
> (aircode... use your own control names)
> Where CustomerName = Forms!frmYourFormName!cboCustomerName
> --
> hth
> Al Campagna
> Microsoft Access MVP
>
http://home.comcast.net/~cccsolutions/index.html>
> "Find a job that you love... and you'll never work a day in your life."
>
>
> "JIM" <JIM[ at ]discussions.microsoft.com> wrote in message
> news:8D0DE2B9-77C8-415F-BF2F-4EE4ACFFE5F0[ at ]microsoft.com...
> > Here's my code to fill a list box when a combo box is updated:
> > Private Sub cboCustomerName_AfterUpdate()
> > Dim sql As String
> > sql = "SELECT tblCustomer.CustomerName, tblClientBuildings.JobAddress1,
> > tblClientBuildings.JobAddress2 FROM tblCustomer INNER JOIN
> > tblClientBuildings
> > ON tblCustomer.CustomerName = tblClientBuildings.CustomerName ORDER BY
> > tblCustomer.CustomerName, tblClientBuildings.JobAddress1,
> > tblClientBuildings.JobAddress2;"
> > Me!lstBuildings.RowSource = sql
> > End Sub
> >
> > When I test a sample query with same sql it works perfect but the listbox
> > is
> > just blank. The records are in the order desired but I don't know how to
> > just select the Buildings that are associated with the Customer Name that
> > was
> > selected in the combo box. Any help appreciated.
> >
>
>
>