Disable automatic expression checking?

F

Frankenbox

I am trying to create a search criteria for a query which selects for entries
by a specific user in a database, or if no-one is specified returns all user
entries.

The following criteria performed the task to my satisfaction:

IIf(IsNull[Which User?],"*",[Which User?])

However upon saving and closing the help feature decided that I needed ""
marks throughout, so that when I opened it to run again the following
expression was in place.

IIf("IsNull[Which User?]","*",[Which User?])

This expression does not work (nor do my attemts at working around the
*helpful* feature)...



How do I prevent Access from treating my like an Idiot and trying to provide
useless assistance?
 
D

Douglas J Steele

The first expression was wrong: you didn't have the parentheses for the
IsNull function:

IIf(IsNull([Which User?]),"*",[Which User?])

If it worked the first time, it was just a coincidence.

Better, though, might be:

Nz([WhichUser?], "*")
 
F

Frankenbox

Thanks!

Douglas J Steele said:
The first expression was wrong: you didn't have the parentheses for the
IsNull function:

IIf(IsNull([Which User?]),"*",[Which User?])

If it worked the first time, it was just a coincidence.

Better, though, might be:

Nz([WhichUser?], "*")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Frankenbox said:
I am trying to create a search criteria for a query which selects for entries
by a specific user in a database, or if no-one is specified returns all user
entries.

The following criteria performed the task to my satisfaction:

IIf(IsNull[Which User?],"*",[Which User?])

However upon saving and closing the help feature decided that I needed ""
marks throughout, so that when I opened it to run again the following
expression was in place.

IIf("IsNull[Which User?]","*",[Which User?])

This expression does not work (nor do my attemts at working around the
*helpful* feature)...



How do I prevent Access from treating my like an Idiot and trying to provide
useless assistance?
 
Top