Jim Lawrence
accessd at shaw.ca
Wed Mar 23 00:08:50 CST 2005
Hi Joe: The way I would do it is to create the whole test in one group with the most likely 'true' at the top and the rest in descending order like: if test one is true then do something elseif test two is true then do something elseif test three is true then do something 'else ' ' do something endif I always like to have an else at the bottom of statement if there is even the slightest chance the code will fail over if some value gets through. That is only necessary if that is what is required. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Joe Hecht Sent: Tuesday, March 22, 2005 9:13 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Is there a preferred style Working alone is the pits. I have three tests to set the value of a text box. What is considered to be good coding practice? 1. if test one is true then do something end if if test two is true then dosomething else do something end if end sub 2. if test one is true then do something else if test two is true then dosomething else do something end if end if end sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com