Hi,
I'm trying to do a cascading combo box from my main form onto my subform with the criteria as an iif statement.
If mainform combo box = "NAT" then i want all records to be avaialble in subform combo box.
If main form combo box = anything but "NAT" then i want it to limit the records by the appropriate region.
the sql code ive got in subform 2 combo box is:
This works ok for the anything but "NAT" condition but not the other.
Thanks.
I'm trying to do a cascading combo box from my main form onto my subform with the criteria as an iif statement.
If mainform combo box = "NAT" then i want all records to be avaialble in subform combo box.
If main form combo box = anything but "NAT" then i want it to limit the records by the appropriate region.
the sql code ive got in subform 2 combo box is:
Code:
SELECT TblContractSite.ID, TblContractSite.CMSRef, TblContractSite.Site, TblLysRegion.SiteName, TblLysRegion.Region, TblLysRegion.BusinessUnit
FROM TblContractSite INNER JOIN TblLysRegion ON TblContractSite.Site = TblLysRegion.Site
WHERE IIf([forms]![frmcontract]![cboregion]="nat",([TblLysRegion].[Region] Like "*" & [forms]![frmcontract]![cboregion] & "*"),([TblLysRegion].[Region])=[forms]![frmcontract].[cboregion]);
This works ok for the anything but "NAT" condition but not the other.
Thanks.