Parameter query return all records when parameter is null

Parameter query return all records when parameter is null

Post by TWlrZSBKb2 » Sat, 17 Sep 2005 03:07:02


I have the following setup in a query. I need return all records if parameter
is left blank.

criteria = [para]+Space(3)
or = [para]+space(3) is Null

also have tried

criteria = [para]+Space(3)
or = [para] is Null

none works, when I supply a value for the parameter or leave it blank access
locks up and I must use task manager to close. anyone have any ideas why.
 
 
 

Parameter query return all records when parameter is null

Post by Michel Wal » Sat, 17 Sep 2005 04:22:24

Hi,



In SQL view, in the WHERE clause, you should read:


... WHERE ( fieldName=[para]+ Space(3) OR para IS NULL ) AND ...



Hoping it may help,
Vanderghast, Access MVP

 
 
 

Parameter query return all records when parameter is null

Post by TWlrZSBKb2 » Sat, 17 Sep 2005 05:48:03

Thanks, Michael. I tried your suggest without succes. I tried setting up a
test query similar to the other. The test query works fine. So I need to find
out what is causing a problem with the Main query. The query is complex and
uses 8 tables. If I determine the problem I will post it.