Re: IIF in SQL Stroed Proceedure

Tech-Archive recommends: Fix windows errors by optimizing your registry



I'm afraid to tell you that you don't work with ADP in the same way as with
Access. You will have to learn how to write stored procedures on the
SQL-Server.

You can also choose to build your Select dynamically and then set the
recordsource of your form to it, something like:

Dim stringSQL as String

If (Me.CheckBox1) then
stringSQL = "select * from MyTable where [Individual Policy] <> 0"
else
stringSQL = "select * from MyTable where [Family Policy] <> 0"
end if

Me.RecordSource = stringSQL

However, you'll still have to learn how to program SQL-Server if you want to
work with it in any case.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC


"Randy Shaw via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx> wrote in
message news:441c2473bc63482496ccb42f467f2c7a@xxxxxxxxxxxxxxxxxxxx
>I have a bound check box on my form and I want to use Select If statement
> that will query the table and determine and return a vale in my query.
> Is
> like an IIF expression
>
> If [CkBox1] is checked 'Check Box 1 is Checked' or If [CkBox2] is checked
> 'Check Box 2 is Checked' 'ELSE 'No Boxes Checked'
>
> --
> Message posted via http://www.accessmonster.com


.