I have a form with multiple list boxes on it.
Users are able to filter results as they make selections in list boxes.
Everything works well until...
In the third list box they make a selection from, the field is held in tblRegion rather than tblSupplierMapCodes and the list box the results appear in goes blank.
Me.List4.RowSource = _
"SELECT PortalData.[Company ID], PortalData.[Company Name] " & _
"FROM tblSupplierMapCodes INNER JOIN (tblSupplierMappingLinkTable INNER JOIN (PortalData INNER JOIN (tblUKPostcodes INNER JOIN SCCDataForServer ON tblUKPostcodes.ID = SCCDataForServer.PostalBrickID) ON PortalData.[Company ID] = SCCDataForServer.[Company ID]) ON tblSupplierMappingLinkTable.SCCID = SCCDataForServer.[SCC Data ID]) ON tblSupplierMapCodes.ID = tblSupplierMappingLinkTable.SupplierCode " & _
"Where tblSupplierMapCodes.[Category Heading] = " & Chr(34) & Me.List0 & Chr(34) & _
"And tblSupplierMapCodes.[Requirements Heading] = " & Chr(34) & Me.List2 & Chr(34) & _
"And tblRegion.[Region] = " & Chr(34) & Me.List6 & Chr(34)
I have had this working really nicely when all the data is in the same table, but this is stressing me out. How do I set the From Statement so that the last filter works, or is there a better way around this?
Thanks for your help
Users are able to filter results as they make selections in list boxes.
Everything works well until...
In the third list box they make a selection from, the field is held in tblRegion rather than tblSupplierMapCodes and the list box the results appear in goes blank.
Me.List4.RowSource = _
"SELECT PortalData.[Company ID], PortalData.[Company Name] " & _
"FROM tblSupplierMapCodes INNER JOIN (tblSupplierMappingLinkTable INNER JOIN (PortalData INNER JOIN (tblUKPostcodes INNER JOIN SCCDataForServer ON tblUKPostcodes.ID = SCCDataForServer.PostalBrickID) ON PortalData.[Company ID] = SCCDataForServer.[Company ID]) ON tblSupplierMappingLinkTable.SCCID = SCCDataForServer.[SCC Data ID]) ON tblSupplierMapCodes.ID = tblSupplierMappingLinkTable.SupplierCode " & _
"Where tblSupplierMapCodes.[Category Heading] = " & Chr(34) & Me.List0 & Chr(34) & _
"And tblSupplierMapCodes.[Requirements Heading] = " & Chr(34) & Me.List2 & Chr(34) & _
"And tblRegion.[Region] = " & Chr(34) & Me.List6 & Chr(34)
I have had this working really nicely when all the data is in the same table, but this is stressing me out. How do I set the From Statement so that the last filter works, or is there a better way around this?
Thanks for your help