I think I'm totally lost...
I have a code that creates a query filtered on the values of one table, and it's fine (works exactly as I wanted);
then I needed to expand it to include records in a second related table (that's where I got all twisted)
the GOAL IS:
to show all the records in table [tblManufacturer] where either
in that table [tblManufacturer], the field [PrimaryCatagoy] meets the criteria in [strIN]
or
in a second table [tblMfrCatagory] (related to [tblManufacturer] by the field [ManufacturerName]), the field [AddlCatagories] meets the same criteria
' this alone executed correctly:
' strSQL = strSQL & "WHERE tblManufacturers.PrimaryCatagory IN(" & Left(strIN, Len(strIN) - 1) & ")"
'this does not execute at all:
strSQL = strSQL & "WHERE (tblManufacturers.PrimaryCatagory IN(" & Left(strIN, Len(strIN) - 1) & "))" _
or _
(tblMfrCatagory.AddlCatagories IN(" & Left(strIN, Len(strIN) - 1) & "));"
End If
'Clear listbox selection after running query"
For Each varItem In Me.lstCatagorySelect.ItemsSelected
Me.lstCatagorySelect.Selected(varItem) = False
Next varItem
Me.Label27.Caption = "Currently filtered to include: " & strLabel
Me.Label27.Visible = True
Forms!frmManufactures.RecordSource = strSQL
MyDB.QueryDefs.Delete "qryCatagories"
Set qdef = MyDB.CreateQueryDef("qryCatagories", strSQL)
greatly appreciated in advance,
Mark