Using IIF? (1 Viewer)

galvinjaf

Registered User.
Local time
Today, 18:16
Joined
Jan 5, 2016
Messages
108
Good Morning,

If I am understanding what IIF does, then I'd like to know how I can use it. I'd like to have a criteria in my query that says, If the input you typed in is the matches the name of a manager, then return the list of dates with JUST that manager. If you don't type in the name of the manager, then return the entire query with all of the managers names and dates.

Does this make sense? I just don't know how to go about setting this up.
 

Attachments

  • iif.JPG
    iif.JPG
    37.6 KB · Views: 47

galvinjaf

Registered User.
Local time
Today, 18:16
Joined
Jan 5, 2016
Messages
108
This works great. One thing, and I'm sure it's simple, but it's giving my a window to put in my criteria, but I'd like to change what displays as '[Forms]![myForm]![myControl] OR [Forms]![myForm]![myControl] Is Null' and instead have it actually ask 'Manager'...I bascially just want to change the caption?

Attached is an example....
 

Attachments

  • iif.JPG
    iif.JPG
    15.4 KB · Views: 36

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:16
Joined
Aug 30, 2003
Messages
36,137
The intention was that you use a form to gather the user input, and change that to your form/textbox names. If you want to use an input box, try

[Enter Manager] OR [Enter Manager] Is Null

Most of us always use forms to gather input, as you have more control.
 

galvinjaf

Registered User.
Local time
Today, 18:16
Joined
Jan 5, 2016
Messages
108
After reading your post, I now get what you're saying. Self teaching myself. thanks for your help! This worked.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:16
Joined
Aug 30, 2003
Messages
36,137
Happy to help!
 

Users who are viewing this thread

Top Bottom