|
|
|
date: Wed, 8 Oct 2008 09:09:29 -0400,
group: microsoft.public.access.reports
back
Re: VBA Code instead of Expression
Allen is correct, but I would like to point out two problems with your
Switch function. First, the correct seperator is a comma, not a semicolon,
secondly there may be a limit to the number of conditions you can include.
I can't remember if this is true of Switch, but it is for some other
functions.
But, in a relational database, data belongs in tables. Use a translation
table as Allen suggests.
"Telesphore" wrote in message
news:C37B749A-13D6-4902-A202-6E3BF97F3C68@microsoft.com...
> In a Report TextBox, instead of this expression that Access 2003 declares
> as "too complex":
>
> =SWITCH(
> [State]="AL";"ALABAMA";
> [State]="AK";"ALASKA";
> [State]="AZ";"ARIZONA";
> [State]="AR";"ARKANSAS";
> [State]="CA";"CALIFORNIA";
> ETC.)
>
> We would like to use VBA Code, for example:
>
> Private Sub Report_Load()
> txtState.Value = IIf(.
> .
> End Sub
>
>
> Any help will be appreciated.
>
> Thank you
>
date: Wed, 8 Oct 2008 09:14:09 -0500
author: Klatuu
|
|