[AccessD] Goodbye Leszynski/Reddick?

Arthur Fuller fuller.artful at gmail.com
Sat Jan 24 13:49:10 CST 2015


Charlotte,

It's projects of that size that initially motivated me to adopt suffix
rather then prefix notation  Bur whether one chooses prefixes or suffixes
matters not. What matters is to choose one method of indicating data type
and stick to it. Utilities such as Rick Fisher's *Find & Replace*  can come
in very handy in this regard, particularly when you've inherited code
written by one or more developers who came before you (in that event it's
not uncommon to find mixed conventions.

On a related subject, a convention that MS's own examples use, and that I
despise, is he passing of empty parameters to commands such as
DoCmd.OpenForm. This is especially onerous when the code is written like
this (the MS sample apps contain lots of this):

DoCmd.OpenForm "frmMyForm",,,"ID=" & Me.ID

In fact, there are three more possible arguments after that.

Much better, in my view, is to pass named arguments:

DoCmd.OpenForm FormName::="frmMyForm", WhereCondition:="ID=" & Me.ID

to this you could even add the final argument and lose the commas
separating the missing arguments:

DoCmd.OpenForm FormName::="frmMyForm", WhereCondition:="ID=" & Me.ID,
OpenArgs:= "Add"

This way it's self-documenting.

A.

On Sat, Jan 24, 2015 at 1:41 PM, Charlotte Foust <charlotte.foust at gmail.com>
wrote:

> When you have hundreds of queries and you're working with a list,
> conventions matter. Finding a query using the nav panel search or checking
> your code, the type name helps.


More information about the AccessD mailing list