If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Yes/No parameter for Yes or No or Both
RonaldoOneNil gave me the very useful info of:
=IIF([Enter Yes or No]="Yes",True,False) for a parameter query criterion (for a check box in a form). I would like to know if I can enter Yes or No AND have the option for both. Presumably it would be in the Or row, but I don't know what to enter. Thanks for any help. |
#2
|
|||
|
|||
Yes/No parameter for Yes or No or Both
Can you explain what you are trying to do with some examples?
-- Build a little, test a little. "Owl" wrote: RonaldoOneNil gave me the very useful info of: =IIF([Enter Yes or No]="Yes",True,False) for a parameter query criterion (for a check box in a form). I would like to know if I can enter Yes or No AND have the option for both. Presumably it would be in the Or row, but I don't know what to enter. Thanks for any help. |
#3
|
|||
|
|||
Yes/No parameter for Yes or No or Both
Thanks for your reply.
I have a form F00 based on a query Q00. In the form there is a field called MatterClosed which is a Yes/No check box. If I put the above expression in the Criterion row of the MatterClosed field in the query, I can type Yes in the dialog box that comes up and I get all the Yes records. If I type No, I get all the No records. However, I would like to have the option to display all records come up. It doesn't work to leave the dialog box blank, because if I don't type anything in the dialog box I get all the No records, NOT all the records, the way I want. Is there a way to combine the above expression with the option to get all records - or even without using the above expression, to have the option to have either the Yes records, or the No records, or all the records. "KARL DEWEY" wrote: Can you explain what you are trying to do with some examples? -- Build a little, test a little. "Owl" wrote: RonaldoOneNil gave me the very useful info of: =IIF([Enter Yes or No]="Yes",True,False) for a parameter query criterion (for a check box in a form). I would like to know if I can enter Yes or No AND have the option for both. Presumably it would be in the Or row, but I don't know what to enter. Thanks for any help. |
#4
|
|||
|
|||
Yes/No parameter for Yes or No or Both
Try this --
IIf([Enter Yes or No]="Yes",True,False) Or Like IIf([Enter Yes or No] Is Null,"*",Null) -- Build a little, test a little. "Owl" wrote: Thanks for your reply. I have a form F00 based on a query Q00. In the form there is a field called MatterClosed which is a Yes/No check box. If I put the above expression in the Criterion row of the MatterClosed field in the query, I can type Yes in the dialog box that comes up and I get all the Yes records. If I type No, I get all the No records. However, I would like to have the option to display all records come up. It doesn't work to leave the dialog box blank, because if I don't type anything in the dialog box I get all the No records, NOT all the records, the way I want. Is there a way to combine the above expression with the option to get all records - or even without using the above expression, to have the option to have either the Yes records, or the No records, or all the records. "KARL DEWEY" wrote: Can you explain what you are trying to do with some examples? -- Build a little, test a little. "Owl" wrote: RonaldoOneNil gave me the very useful info of: =IIF([Enter Yes or No]="Yes",True,False) for a parameter query criterion (for a check box in a form). I would like to know if I can enter Yes or No AND have the option for both. Presumably it would be in the Or row, but I don't know what to enter. Thanks for any help. |
#5
|
|||
|
|||
Yes/No parameter for Yes or No or Both
You could enter the criteria in a "box" under your yes/no field as
[Enter Yes or No]="Yes" Or [Enter Yes or No] Is Null That will get reformatted by Access when it is saved. In SQL view that would read something like WHERE (YourField = [Enter Yes or No]="Yes" OR [Enter Yes or No] Is Null) If the parameter is "Yes" then the first part of the expression evaluates to YourField = True If No, then YourField=False If blank (null) then YourField = Null and then the second part of the expression kicks in and gets evaluated as Null is Null (therefore TRUE and therefore all the records are returned) John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County KARL DEWEY wrote: Try this -- IIf([Enter Yes or No]="Yes",True,False) Or Like IIf([Enter Yes or No] Is Null,"*",Null) |
#6
|
|||
|
|||
Yes/No parameter for Yes or No or Both
I have been looking for the answer to this very question and what you
suggested works perfectly for me. thanks, -- javablood "KARL DEWEY" wrote: Try this -- IIf([Enter Yes or No]="Yes",True,False) Or Like IIf([Enter Yes or No] Is Null,"*",Null) -- Build a little, test a little. "Owl" wrote: Thanks for your reply. I have a form F00 based on a query Q00. In the form there is a field called MatterClosed which is a Yes/No check box. If I put the above expression in the Criterion row of the MatterClosed field in the query, I can type Yes in the dialog box that comes up and I get all the Yes records. If I type No, I get all the No records. However, I would like to have the option to display all records come up. It doesn't work to leave the dialog box blank, because if I don't type anything in the dialog box I get all the No records, NOT all the records, the way I want. Is there a way to combine the above expression with the option to get all records - or even without using the above expression, to have the option to have either the Yes records, or the No records, or all the records. "KARL DEWEY" wrote: Can you explain what you are trying to do with some examples? -- Build a little, test a little. "Owl" wrote: RonaldoOneNil gave me the very useful info of: =IIF([Enter Yes or No]="Yes",True,False) for a parameter query criterion (for a check box in a form). I would like to know if I can enter Yes or No AND have the option for both. Presumably it would be in the Or row, but I don't know what to enter. Thanks for any help. |
#7
|
|||
|
|||
Yes/No parameter for Yes or No or Both
Thank you, Karl. It worked perfectly. I am sorry I have only thanked you
now. I forgot to mark the Notify Me Of Replies box and have only just seen this now. "KARL DEWEY" wrote: Try this -- IIf([Enter Yes or No]="Yes",True,False) Or Like IIf([Enter Yes or No] Is Null,"*",Null) -- Build a little, test a little. "Owl" wrote: Thanks for your reply. I have a form F00 based on a query Q00. In the form there is a field called MatterClosed which is a Yes/No check box. If I put the above expression in the Criterion row of the MatterClosed field in the query, I can type Yes in the dialog box that comes up and I get all the Yes records. If I type No, I get all the No records. However, I would like to have the option to display all records come up. It doesn't work to leave the dialog box blank, because if I don't type anything in the dialog box I get all the No records, NOT all the records, the way I want. Is there a way to combine the above expression with the option to get all records - or even without using the above expression, to have the option to have either the Yes records, or the No records, or all the records. "KARL DEWEY" wrote: Can you explain what you are trying to do with some examples? -- Build a little, test a little. "Owl" wrote: RonaldoOneNil gave me the very useful info of: =IIF([Enter Yes or No]="Yes",True,False) for a parameter query criterion (for a check box in a form). I would like to know if I can enter Yes or No AND have the option for both. Presumably it would be in the Or row, but I don't know what to enter. Thanks for any help. |
#8
|
|||
|
|||
Yes/No parameter for Yes or No or Both
Thank you for your response, John. However, it didn't work. I do have the
response of Karl's that does, but just thought you would probably like to know anyway. Smiles. Sorry I am late with my thank you. Only saw it now. Forgot to mark the Notify Me Of Replies box. "John Spencer" wrote: You could enter the criteria in a "box" under your yes/no field as [Enter Yes or No]="Yes" Or [Enter Yes or No] Is Null That will get reformatted by Access when it is saved. In SQL view that would read something like WHERE (YourField = [Enter Yes or No]="Yes" OR [Enter Yes or No] Is Null) If the parameter is "Yes" then the first part of the expression evaluates to YourField = True If No, then YourField=False If blank (null) then YourField = Null and then the second part of the expression kicks in and gets evaluated as Null is Null (therefore TRUE and therefore all the records are returned) John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County KARL DEWEY wrote: Try this -- IIf([Enter Yes or No]="Yes",True,False) Or Like IIf([Enter Yes or No] Is Null,"*",Null) . |
Thread Tools | |
Display Modes | |
|
|