I am not sure if an iif is the solution to my problem.
I have a query that looks at two combo boxes. What I want to do is use only the combo boxes that are populated in my query. If they are null, don't include them in query.
I would like to add in the Where statement something like
Iff IsNull([Forms]![PropertyEntry]![PrimaryTownID]), <> PrimaryTownID, (Don't do anything)
I am not sure how to write this.
Here is my query:
Thanks
I have a query that looks at two combo boxes. What I want to do is use only the combo boxes that are populated in my query. If they are null, don't include them in query.
I would like to add in the Where statement something like
Iff IsNull([Forms]![PropertyEntry]![PrimaryTownID]), <> PrimaryTownID, (Don't do anything)
I am not sure how to write this.
Here is my query:
Code:
SELECT [RuralAreas].[RuralAreasName], Municipalities.MunicipalitiesID
FROM RuralAreas INNER JOIN Municipalities ON RuralAreas.RuralAreasID = Municipalities.RuralAreasID
WHERE Municipalities.MunicipalitiesID)<>[Forms]![PropertyEntry]![PrimaryTownID]
And Municipalities.MunicipalitiesID)<>[Forms]![PropertyEntry]!![SecondaryTownID]