473,385 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Microsoft's choice to default form textbox names to related table field names - good or bad?

MLH
Generally, I do not monkey with renaming controls on forms
whose name, by default, matches the name of their related
table fields. But I noticed the following today

If IsNull(Me!VColor) Then
DoCmd.CancelEvent
SaveButtonClicked = False
MyString = "You must tell us the color of the vehicle."
MyString = MyString & "Please choose the vehicle color from "
MyString = MyString & "the drop-down box provided on form."
MsgBox MyString, vbExclamation, "Vehicle Color Required - "
Exit Sub
End If

This code has been in my app for 9-mos. "What's the point", you ask?
The point is this: The control's name is NOT VColor. Its a combo-box
control and its name is ColorChooserBox. The related table field name
is [VColor].

A line in there like this
Me!VColor.BackColor = 255
would-a-produced an error. I would-a-seen & fixed it.
But because Null is a perfectly acceptable value for the table field
value - I got no error. I would have appreciated one, however. The
result of this SNAFU is not monumental really. Because either of the
following in the immediate window yield the same result:

?forms!frmVehicleEntryForm!VColor
Azure
?forms!frmVehicleEntryForm!ColorChooserBox
Azure

But how do I knoiw that I won't be so lucky in another situation
that's similar - but slightly different. Is it possible, in A97, for
Access to use a different naming convention for controls on forms?
I would-a-been happier, I think, if Microsoft had defaulted names to
something like ctlVColor or comboxVColor or cboxVColor. I think I
would-a-been happier with cbox1, cbox2, cbox3... like they do with
command buttons.
Apr 6 '06 #1
3 1694
MLH wrote:
Generally, I do not monkey with renaming controls on forms
whose name, by default, matches the name of their related
table fields.


<snip>

I didn't follow what you were trying to say in the rest of your post,
MLH, but the above definitely caught my eye.

I personally make it a habit to definitely rename bound controls to a
standard naming convention. Otherwise you end up with a lot of #Name!
type errors when trying to perform actions or procedures on controls. I
always advise newbies to do the same and tell them it's never good
practice to do what you describe above unless there is no coding
whatsoever connected with the form/report.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Apr 6 '06 #2
MLH
<snip>
I didn't follow what you were trying to say in the rest of your post,
MLH, but the above definitely caught my eye.

I personally make it a habit to definitely rename bound controls to a
standard naming convention. Otherwise you end up with a lot of #Name!
type errors when trying to perform actions or procedures on controls. I
always advise newbies to do the same and tell them it's never good
practice to do what you describe above unless there is no coding
whatsoever connected with the form/report.


I tend to agree with you. Would be nice if we could set a low-level
option specifying our desired control naming convention to A97.
Apr 7 '06 #3
MLH wrote:
I tend to agree with you. Would be nice if we could set a low-level
option specifying our desired control naming convention to A97.


Agreed. Or even if it just didn't name it the same as the blinking
controlsource!!! 8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Apr 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Mic | last post by:
Goal: delay execution of form submit Code (Javascript + JScript ASP): <% Response.Write("<OBJECT ID='IntraLaunch' STYLE='display : none' WIDTH=0 HEIGHT=0...
5
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce...
3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
1
by: Johnfcf | last post by:
I have a database consisting of 3 tables, the main table with main contact info, a second table with additional address info and a third table consisting of additional contact information, or more...
0
by: Jason | last post by:
I would like to be able to place a command button on a primary (parent) form that opens up a subform. I want to use this subform to search for or limit the recordset of data in the primary form. ...
0
by: V Arzola | last post by:
I've done extensive work developing a large on-line application form, only to find that it will not render properly in Firefox (1.5.0.1) or Netscape (8.0). The panels are overlapping each other...
2
NeoPa
by: NeoPa | last post by:
CHAPTER 1 - TABLE OF CONTENTS (Including attached database) CHAPTER 2 - INTRODUCTION CHAPTER 3 - TABLE LAYOUT CHAPTER 4 - FORM LAYOUT CHAPTER 5 - FORM MODULE CHAPTER 6 - CODE DISCUSSION (FILTER...
4
theaybaras
by: theaybaras | last post by:
Hi everyone, You've all been such a huge help to me since joining, and I'd just like to take a second to let you know how much I appreciate it! That said, I have another supplication! ;) I have...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.