Darryl Collins
Darryl.Collins at iag.com.au
Mon May 3 00:20:32 CDT 2010
_______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Alright, I have already figured out something about this (which I sort of already knew). Using the me.mycontrol syntax will ensure the control actually exists. This solution I am working on which doesn't use that syntax has numerous ghost references to controls which don't exist on the form. I can see the benefits of compiling often and using Option Explicit - something which doesn't seem to have been done at this stage on the current solution. Taking a more explicit approach has already borne considerable fruit, even if it is (a little) more effort to type. Cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl Collins Sent: Monday, 3 May 2010 2:39 PM To: accessd at databaseadvisors.com Subject: [AccessD] How explicit do you need to be? _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Hi Folks, Finally back on the list after changing roles. Curious about this. Personally I have always been very precise with references etc as it seems to improve performance and reliability. However, does it really matter that much? For example what are the advantages and/risk of using the following syntax x = txtMyTextBox VS x = me.txtMyTextBox.value Or txtFarm.Visible = False lblFarm.Visible = False txtHire.Visible = True lblHire.Visible = True VS With me .txtFarm.Visible = False .lblFarm.Visible = False .txtHire.Visible = True .lblHire.Visible = True End with I would normally always use the longer syntax, although for typing reasons I can see the appeal of the shorter style. In the case of the first example, I guess the .value is the default so that is probably redundant, although I like the way it is clear exactly what it is you are looking at/for. So what would be considered 'best (or better) practice' with coding for this example? Or more importantly, which style will return the results faster and reliably? Cheers Darryl. _____________________________________ Darryl Collins | Database Developer Insurance Australia Group + 61 3 9916 3926 (Desk) + 61 418 381 548 (Mobile) _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________