IF and mutliple selects

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

Guest

Is there a way to do something like an if else so that I can run one of two
selects based on a form field? Something like

IF form!fiield = true
selct ....
else
select....
 
Use the function IIF() in a calculated field:

CalcField: IIF([Forms]![FormName]![FormControl]=True,"ValueTrue","ValueFalse")


I'm not sure if meant you wanted further choices (i.e. a real Select Case...).
If you do, you can nest IIF() statements to achieve this.
 
IIF will not work in this case. A query in Access will not let you start with
iif for one and two if you try this is will not let you return more than one
row. I need to do a select if the value is true that will return multiple
rows.

kingston via AccessMonster.com said:
Use the function IIF() in a calculated field:

CalcField: IIF([Forms]![FormName]![FormControl]=True,"ValueTrue","ValueFalse")


I'm not sure if meant you wanted further choices (i.e. a real Select Case...).
If you do, you can nest IIF() statements to achieve this.

Is there a way to do something like an if else so that I can run one of two
selects based on a form field? Something like

IF form!fiield = true
selct ....
else
select....
 
You can use an IIF statement in your criteria of the query.

Post an example of your data and what you would have in the form.
--
KARL DEWEY
Build a little - Test a little


Dale said:
IIF will not work in this case. A query in Access will not let you start with
iif for one and two if you try this is will not let you return more than one
row. I need to do a select if the value is true that will return multiple
rows.

kingston via AccessMonster.com said:
Use the function IIF() in a calculated field:

CalcField: IIF([Forms]![FormName]![FormControl]=True,"ValueTrue","ValueFalse")


I'm not sure if meant you wanted further choices (i.e. a real Select Case...).
If you do, you can nest IIF() statements to achieve this.

Is there a way to do something like an if else so that I can run one of two
selects based on a form field? Something like

IF form!fiield = true
selct ....
else
select....
 
Back
Top