[AccessD] VBA Field Names - Curiosity Question

Arthur Fuller fuller.artful at gmail.com
Wed Jul 3 12:17:26 CDT 2013


I hate globals and prefer static functions (also known as get/set
functions). They are way superior to global vars. I wrote about this (maybe
TechRepublic, can't recall, doesn't matter, and will be happy to supply
some example code upon request. Another approach is to create classes,
which IMO is too complex, but I'm flexible on this topic.I like static
functions because they are compact and consist of only few lines of code;
of course they do not work when passed to a SQL back end, but within Access
they are wonderful. So my final recommendation is this: if the BE is
Access, static functions are wonderful; If the BE is something else, say
MuSQL or MS-SqlServer or Oracle, then static functions should be avoided.


On Wed, Jul 3, 2013 at 10:10 AM, Rocky Smolin <rockysmolin at bchacc.com>wrote:

> I love globals.  Like Dan I often set them on opening the app - like the
> full path and file name of the back end database, or the folder where the
> front end is located which I will use as the target for an exported file or
> spreadsheet.  I use gconRed = 255, gconBlue = 8404992 to set colors in
> forms.  Globals are your friend!
>
> Rocky
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
> Sent: Wednesday, July 03, 2013 7:04 AM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] VBA Field Names - Curiosity Question
>
> Global values help me a lot.  In almost all cases I set the value as the
> app
> starts, and in only one case out of about 50 those values are never
> changed.
>
> Also, EverythingAccess.com has a new version, V3, of their product
> vbWatchdog.  With this version you don't necessarily lose the value of
> Globals when you have an error.  Go here:
> http://www.everythingaccess.com/vbwatchdog/changesinv3.htm, scroll down to
> Global Error Trap improvements.  I've been using this product for several
> years and am very happy with it.
>
> Dan
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark Simms
> Sent: Tuesday, July 02, 2013 8:00 PM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] VBA Field Names - Curiosity Question
>
> Sorry Brad, but adherence to disciplined naming conventions make a HUGE
> difference towards ease of maintenance.
>
> Especially critical : Use of Globals !!
> And don't get me started on the danger of globals.
>
> > Examples -
> > 01 Part-Number   PICTURE X(30).
> > 01 Part-Cost    Comp-3    PICTURE 9(05).
> >
> >
> > In VBA examples, I see most people using prefixes such as Str, Lng,
> > Dat, Etc.
> >
> > I have never quite understood why people do this when working with VBA
> > while I believe that very few people did this in the COBOL realm.
> >
> > In COBOL we would simply look at the Picture clause in the field name
> > definition.  This would be the equivalent of looking at the DIM
> > statement.
> >
> > Again, this is just a curiosity question.
> >
> > Thanks,
> > Brad
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



-- 
Arthur
Cell: 647.710.1314

Prediction is difficult, especially of the future.
  -- Niels Bohr


More information about the AccessD mailing list