[AccessD] Eval Function... (or a better way)

Josh McFarlane darsant at gmail.com
Tue Jan 31 13:18:19 CST 2006


On 1/31/06, Heenan, Lambert <Lambert.Heenan at aig.com> wrote:
> No need for Eval.
>
> If you control are *consistently* named you can try...
>
> Function TurnMeOn(bWhichWay as boolean)
>    Dim n as integer
>    Dim s as string
>
>    n = 1
>    With Me
>    Do While n < 21
>      .Controls("Check" & n) = bWhichWay
>       n = n + 1
>    loop
>    End With
> End Function
>
> Which eliminates he need to use the Tag property.

I don't know, I may just be prejudiced against string manupulating
control names. Tags allow me to seperate things into nice
organizational chunks, and I can add a new control without needing to
touch the underlying code. OTOH, if I change the name of a control
while using strings, it won't give me a problem until I execute the
code, which can be nasty sometimes if you miss testing it.

--
Josh McFarlane

"Peace cannot be kept by force. It can only be achieved by understanding."
-Albert Einstein



More information about the AccessD mailing list