[AccessD] How explicit do you need to be?

Rocky Smolin rockysmolin at bchacc.com
Mon May 3 00:31:00 CDT 2010


I like using me. Because of the auto fill and because it's more
self-documenting and I get fewer typos.  I also use Option Explicit on every
module.  Stop a lot of bugs.

R


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl Collins
Sent: Sunday, May 02, 2010 9: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




More information about the AccessD mailing list