PC Review


Reply
Thread Tools Rate Thread

Automatic control names

 
 
Dennis Snelgrove
Guest
Posts: n/a
 
      21st Apr 2010
I feel stupid asking this question, but I can't find any previous
posts about it.

Is it possibe to set Access 2007 so that the forms wizard will name
the controls properly? The default is to name the control with the
field name of the data source, but it ignores the proper naming
conventions (or at least what I was taught was the convention). A
textbox should be named "txtFirstName", but instead it just names it
"FirstName", which then requires us to have to go through and manually
rename all the controls.

I suppose that a VBA routine can be written, but after this many
versions of Access it should be at least an option under "Tools,
Options".
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      21st Apr 2010
On Tue, 20 Apr 2010 17:59:49 -0700 (PDT), Dennis Snelgrove
<(E-Mail Removed)> wrote:

>I feel stupid asking this question, but I can't find any previous
>posts about it.
>
>Is it possibe to set Access 2007 so that the forms wizard will name
>the controls properly? The default is to name the control with the
>field name of the data source, but it ignores the proper naming
>conventions (or at least what I was taught was the convention). A
>textbox should be named "txtFirstName", but instead it just names it
>"FirstName", which then requires us to have to go through and manually
>rename all the controls.
>
>I suppose that a VBA routine can be written, but after this many
>versions of Access it should be at least an option under "Tools,
>Options".


This actually brings up a pretty contentious issue. Not everyone uses that
naming convention (or any naming convention at all). Some people I respect a
lot use the same-name default and have no problems with it. I do prefer to
rename controls (txtFirstName, cboEmployeeID, etc.) but generally do it
manually.

I'd be very interested in a wider discussion of the topic!
--

John W. Vinson [MVP]
 
Reply With Quote
 
Dennis Snelgrove
Guest
Posts: n/a
 
      21st Apr 2010
On Apr 20, 9:58*pm, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
> This actually brings up a pretty contentious issue. Not everyone uses that
> naming convention (or any naming convention at all). Some people I respect a
> lot use the same-name default and have no problems with it. I do prefer to
> rename controls (txtFirstName, cboEmployeeID, etc.) but generally do it
> manually.
>
> I'd be very interested in a wider discussion of the topic!


I know that some people use different conventions. I use qry for a
Select query, aqry, uqry, dqry, etc. as is appropriate. frm and sfrm,
chk for checkbox, cbo for combobox. And on it goes. My point is that
if Microsoft made it a checkbox option in the Options menu, they could
adopt any given naming convention that makes sense. If it's an option,
the user can leave it unchosen and get the current set-up. Speaking
for myself, I don't mind adopting to a slightly different convention
if it's a logical one. Or if they wanted to get technical, set up a
table in the Options menu where the user can enter the desired
prefixes for any/all controls (by type) and as the wizard makes the
form, it can prepend (is that a word?) the prefix, if there is one.

I also would be interested in a discussion...
 
Reply With Quote
 
David W. Fenton
Guest
Posts: n/a
 
      21st Apr 2010
John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in
news(E-Mail Removed):

> On Tue, 20 Apr 2010 17:59:49 -0700 (PDT), Dennis Snelgrove
><(E-Mail Removed)> wrote:
>
>>I feel stupid asking this question, but I can't find any previous
>>posts about it.
>>
>>Is it possibe to set Access 2007 so that the forms wizard will
>>name the controls properly? The default is to name the control
>>with the field name of the data source, but it ignores the proper
>>naming conventions (or at least what I was taught was the
>>convention). A textbox should be named "txtFirstName", but instead
>>it just names it "FirstName", which then requires us to have to go
>>through and manually rename all the controls.
>>
>>I suppose that a VBA routine can be written, but after this many
>>versions of Access it should be at least an option under "Tools,
>>Options".

>
> This actually brings up a pretty contentious issue. Not everyone
> uses that naming convention (or any naming convention at all).
> Some people I respect a lot use the same-name default and have no
> problems with it. I do prefer to rename controls (txtFirstName,
> cboEmployeeID, etc.) but generally do it manually.


I use the default name until the point that:

1. the control is referenced in VBA code, OR

2. the code gets one of its own events defined in VBA code.

In other words, I don't rename until the point at which it's needed.

> I'd be very interested in a wider discussion of the topic!


I find it very annoying that the Fields collection on forms has been
made almost useless by Access's inability to properly resolve
references to members of that collection if they are not duplicated
in a control's ControlSource. That started to be a problem in A2000
and has gotten worse since.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic names in workbook avi Microsoft Excel Programming 0 19th Jul 2007 08:58 PM
Automatic File Names chrismusic79 Microsoft Excel Misc 2 29th Aug 2006 01:22 PM
Automatic File Names =?Utf-8?B?U2hlbGFnaA==?= Microsoft Word Document Management 6 19th Apr 2006 11:16 AM
Using control array run time with different control names AB Microsoft VB .NET 4 18th Jan 2006 02:22 PM
Should Form Control names differ from Field names? Bam Bam Microsoft Access 6 22nd Sep 2004 08:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:00 PM.