Parameter query return all records when parameter is null

M

Mike Johnson

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.
 
M

Michel Walsh

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
 
M

Mike Johnson

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.

Michel Walsh said:
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


Mike Johnson said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top