Heenan, Lambert
Lambert.Heenan at AIG.com
Tue Jan 31 13:35:19 CST 2006
I agree. And that's why I emphasized *consistently*. I use the Tag property myself for this reason, but I just posted this to show Jeff another way to solve his problem. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Josh McFarlane Sent: Tuesday, January 31, 2006 2:18 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Eval Function... (or a better way) 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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com