FredFred said:
Thanks, but that's not what I meant, my problems is actually the reverse.
Sorry for the ambiguous wording.
If, in the table, I change a field name from "FieldA" to "FieldB", the
code
errors out if I call FieldB. But it accesses the field if I use the OLD
/
gone name "FieldA".
That is not correct and normal behavior of ms-access.
I suspect you being confused by the name of control on a form that *often*
has the SAME name as a underlying field, but they don't have to. In fact,
many a developers NEVER name controls on the screen the same as the fields
to remove the confusing here.
You have to post the one line of code, but if your actually reference the
field, and not a control, then if you change the name, the your code needs
to be changed....
You have to post the one line of code that "seems" to be working correct
with the "old" field name. I suspect the code is not actually referencing a
old field name..but a control on a form.
Note that a form DOES create references to field names, and you can
generally use the "dot" notation, but if you change the forms record source
at a runtime, or rename fields...then those references are not always
updated. (unless you go into the form, change the data source, and change it
back).
As a result of the above, you generally should use:
1) to reference a forms underlying data, use bang notation
me!NameOf field, or for a full form ref, use
forms!NameOfForm!NameOfDataField
2) to reference a control on a form, use dot notation
regardless of the
underlying data or even a un-bound form, use
me.nameOfcontorl, or for a full form ref, use
forms!NameOfForm.NameOfContorl
So, if you had been using bang notation to reference the underlying data in
the first palce, changing the field name will force you to change your
code...