[AccessD] Open a combobox on entering it

Charlotte Foust cfoust at infostatsystems.com
Mon Jul 2 13:06:43 CDT 2007


I don't have concrete evidence at hand, A. D., but I have run into
problems with code references to a control with the same name as the
underlying field because controls have different methods and properties
available that fields do.  I would suspect that there is also a penalty
to pay for making the Access app figure out which one you're addressing
rather than spelling it out by using different names.  I'm not working
much in Access anymore, so it will take me time to track down actual
examples.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D.TEJPAL
Sent: Monday, July 02, 2007 10:59 AM
To: Access Developers discussion and problem solving
Cc: adtp at airtelbroadband.in
Subject: Re: [AccessD] Open a combobox on entering it

Naming of Bound Controls On Forms / Reports (Visa Vis Record Source)
==================================

Arthur,

    You need not feel apprehensive about your style of letting the name
of pure bound controls remain the same as that of pertinent field in the
record source.

    There is no evidence that naming a pure bound control same as its
control source leads to any problem. Following postulation appears to
hold good:

====================================
    1 - An unbound or calculated control should not have its name
identical to any of the fields contained in the record source. 
    2 - At the same time, it is perfectly Ok if the name of a pure bound
control is the same as its control source, which of course is one of the
fields in the record source.
====================================

    If any members of the forum would like to disagree, the reason may
kindly be posted along with concrete evidence supporting it. It might be
desirable to clear the picture for a large number of access users, who
might feel somewhat over-whelmed by the universal assertion that no
control should carry the same name as that of a field in the record
source.

    What needs to be emphasized is that on a report or bound form,
naming of calculated or unbound controls the same as the name of a field
in the record source, could be a recipe for disaster, virtually
equivalent to creation of imposter controls and should never be done.

    On the other hand, it should be perfectly all right to name pure
bound controls the same as the record source field that serves as
control source. In fact it could be the preferred practice,
distinguishing such controls from others, which should carry a prefix
like Txt or Cbo etc.

    Unfortunately, quite often, advice given in access forums makes a
flat recommendation against naming of controls same as field names,
without explicitly clarifying that the precaution is applicable to other
than pure bound controls.

Best wishes,
A.D.Tejpal
---------------

  ----- Original Message -----
  From: Arthur Fuller
  To: Access Developers discussion and problem solving
  Sent: Monday, July 02, 2007 15:34
  Subject: Re: [AccessD] Open a combobox on entering it


  I know that lots of people here despise that style, but I've been
naming
  controls the same as their data source for about 15 years and this dog
is
  too old for new tricks. In a few months I'll be 60. Of course, I'm too
poor to choose retirement at 60. I'm learning Java currently, but it's
not really a new trick :-)

  There must be something else going on here. I just whipped up a tester
in Access 2000 and the dropdown attribute is available in the OnEnter
event. I repeated it in 2003 and it worked. I repeated it in 2003
against a SQL database and it worked. So there must be something odd
about the database I was working on when the problem arose. My testers
created one combo using a value list and another using a table.

  So I have no idea why I wasn't able to get it before.

  Arthur
--
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