Jim Lawrence
accessd at shaw.ca
Tue Jul 3 07:08:38 CDT 2007
Hi A.D. Tejpal: If you would like I could give you a copy of the application before I played around with it. The application was giving the strangest errors. In one example: a combo box would not take the assignment of an initial value but there were no error messages generated... and the issue was not consistent... sometimes it would work fine... but when the combo box name was changed this problem was gone with no other modifications. I have read some warning about this effect, a number of years ago, the article discussed 'Context and Naming-Conventions' but I can not find any reference to the white-paper. Maybe someone else can remember? Jim -----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 9:46 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Open a combobox on entering it Jim, Would you be in a position to isolate a typical form or report that has caused trouble on account of control names as mentioned in your post, and make it available as a self contained small db, for further investigation ? Best wishes, A.D.Tejpal --------------- ----- Original Message ----- From: Jim Lawrence To: 'Access Developers discussion and problem solving' Sent: Tuesday, July 03, 2007 00:28 Subject: Re: [AccessD] Open a combobox on entering it Hi Charlotte: I have just been running into problems with the controls named the name of the data field... A client has this package and all sorts of weird things were happening. At 3:00AM, I started naming control appropriately and things started magically working :-) The strange thing is that the app never complained it just didn't work right and the results were never consistent... So, don't do it Arthur... if only for your own health and sanity. :-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, July 02, 2007 11:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Open a combobox on entering it 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 --------------- << SNIPPED >> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com