I have a query that involves nearly 10 fields. I have a form that I use to input criteria for the query. My problem is that when I enter criteria for multiple fields, I get more records than what I ask for. For instance, if I ask for all Buildings that have Street Numbers between 2000 and 4000, it returns all properties (raw land & buildings) with Street Numbers between 2000 and 4000. I'm pretty sure the problem is in the Or statement, but I can't get it to work with the And statement.
Also, remember there are seven other fields with the same thing. I've shortened it to post it. Please help if you can. Thanks.
Code:
SELECT [Property List].[Property ID], [Property List].[Property Type], [Property List].[Street Number]
FROM [Property List]
WHERE (
(([Property List].[Property ID] Like [Forms]![Query Criteria]![Text39]) Or ([Forms]![Query Criteria]![Text39] Is Null))
Or
(([Property List].[Property Type] Like [Forms]![Query Criteria]![Text41]) Or ([Forms]![Query Criteria]![Text41] Is Null))
Or
((([Property List].[Street Number]) Between [Forms]![Query Criteria]![Text42] And [Forms]![Query Criteria]![Text56]) Or ([Forms]![Query Criteria]![Text42] Is Null) Or ([Forms]![Query Criteria]![Text56] Is Null))
);
Also, remember there are seven other fields with the same thing. I've shortened it to post it. Please help if you can. Thanks.