IIF and NULL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please help me in this issue

if stidcmb value is 0 then i want run the query without any criteria.
IIf([Forms]![searchfrm]![stidcmb]=0,"",2)

this doesnt work..........

Thanks
 
How is your question related to Null?

Post the SQL String of your Query.
 
I agree with Van that your question appears to have nothing to do with the
Subject. However, to answer just your question, put the following as the
criteria (assuming you're using the query builder grid):

[Forms]![searchfrm]![stidcmb] Or ([Forms]![searchfrm]![stidcmb]=0)

This should generate SQL along the lines of

WHERE (MyField = [Forms]![searchfrm]![stidcmb]) Or
([Forms]![searchfrm]![stidcmb]=0)
 
Success !
Thanks
in my query some places i have to give [stidcmb]="0"
and in some place like this
[stidcmb]=0

and in some place
[stidcmb]="All"

because i have my combo box condition ????


Many Thanks


Douglas J. Steele said:
I agree with Van that your question appears to have nothing to do with the
Subject. However, to answer just your question, put the following as the
criteria (assuming you're using the query builder grid):

[Forms]![searchfrm]![stidcmb] Or ([Forms]![searchfrm]![stidcmb]=0)

This should generate SQL along the lines of

WHERE (MyField = [Forms]![searchfrm]![stidcmb]) Or
([Forms]![searchfrm]![stidcmb]=0)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



ismail said:
Please help me in this issue

if stidcmb value is 0 then i want run the query without any criteria.
IIf([Forms]![searchfrm]![stidcmb]=0,"",2)

this doesnt work..........

Thanks
 

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

Back
Top