[AccessD] Question re calculated text control on Report

Steve Schapel steve at datamanagementsolutions.biz
Fri Jul 25 23:10:31 CDT 2014


Where people sometimes have problems is if they have a control with the same 
name as a field, and then they edit the Control Source, say to a calculated 
expression, and don't change the name of the control.  In this case, we have 
a control and a field both with the same name, BUT the control is not bound 
to that field.  This is a problem.

So the rule should be:  do not name a control the same as the name of a 
field in the report's Record Source, unless the control is bound to that 
field.

There is, of course, no problem with the control being named something other 
than the name of the field it is bound to.  But equally, there is no problem 
with a bound control having the same name as its Control Source field.

Regards
Steve

-----Original Message----- 
From: Dan Waters
Sent: Saturday, July 26, 2014 2:02 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Question re calculated text control on Report

Hi Borge,

An important practice on Access reports is to rename the textboxes so that
they are different from any Control Source name.  The reports can get
confused over this.

Name:      txtLastName
Source:    LastName

Good Luck!
Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Borge Hansen
Sent: Friday, July 25, 2014 3:45 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Question re calculated text control on Report

MS Access 2003

The question concerns a calculated text control on a report that for example
primarily concatenates a number of "fields" including testing for whether a
"field" has any text, etc. etc.

I am re-visiting a report to make changes and see that none of the "fields"
referred to such a  calculated text control exist as text controls
themselves on the report.

The "fields" are columns from the report's record source query.

I seem to recall that in the past I have run into problems when the query
fields used on a calculated text control were not present as (hidden or zero
sized) text controls on the report.

A hidden text control would as an example have same name as the Control
Source
Name: LastName
Control Source: LastName

So what is best practice here?

a) ok to refer to query columns in the record source query on calculated
text controls

or

b) for query columns that we make reference to on a calculated text control
- always have them present on the report as (hidden or zero sized) text
controls themselves

??

What is really going on behind the scenes? I have always been unsure about
text controls having as name same name as the Control Source (the control
source being either a table column name or query column name)


/borge
--
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 



More information about the AccessD mailing list