to*******@msn.c om wrote:
>Should text boxes or combo boxes be renamed on bound forms?
In other word should the Department Name property be the same as
Control Source property?
I never rename them, but my IT manager seems to think they should be.
My IT manager is afraid he will be updating the Department column,
when he is trying only display a value in the text box without
changing the value in the table.
I think your IT manager has the right idea for the wrong
reason. If you assign a value to a bound control or its
field, regardless of their names, you will change both of
them.
IMO, you should rename a control whenever you reference it
in a control source expression or in an event procedure. A
common practice is to prefix the field name with three
characters that indicate the type of the control. E.g. a
text box bound to the field ABC would be named txtABC.
In general, if a name could be either a contol or a field, a
reference will be to the control, but, personally, I don't
want to rely on that.
Note that a control source expression can not refer itself
(circular reference). This means, for example, that text
box ABC can not use an expression that refers to field ABC.
To use that kind of expression, the text box must be
renamed.
--
Marsh