J
JIM
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.
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.