I glad you unraveled the reference issue and I'm sorry if I
sounded snippy about terminology, but when working on a
problem, exact wording is essential to clear communications.
Actually, now that you've explained what was happening, I
see that part of the confusion was caused by the use of the
word field to mean two different things. Technically, a
"field" is a column in a table/query. The things that
display values on a form/report are "controls". Normally,
the distinction can be made by the context in which it is
used, but in this case both meanings are in play in the same
sentence.
It's quite likely that at least part of the ambiguity could
have been avoided by using the common convention of naming
each bound control with the control type as a prefix to the
bound field's name. For example, the text box control bound
to the AltWds field would be named txtAltWds.
--
Marsh
MVP [MS Access]
r. howell said:
Thanks very much. Not to nitpick, but in the first post I did say that I was
getting the first value in the group. Granted "first value of the field in
the query" is more accurately worded, and I had said "does not work" first.
The circularity issue and the values being different depending on where the
text box is located combined to produce my problem.
The text box that was giving me problems is in the detail field, but for
reasons I cannot now remember, but will fix, I have another field in a footer
called AltWds. So =AltWds was looking at that, not at the value of AltWds
for each detail in the field.
Thank you very, very much for the general information.
Marshall Barton said:
Instead of "Does not work" or "Does not produce the results
I was anticipating", you should have said " I am getting the
first value of the field in the query".
This depends on where you have the text box, not on whether
there's an = sign or not.
In the report header/footer section, a bound text box will
display the first/last record's value. In the Page
header/footer, it will display the value from the
first/last record on the page. In a group header/footer,
the first/last in the group. In the detail section it will
display each record's value.
With that as background info, what do you want to get?
--
Marsh
MVP [MS Access]
r. howell wrote:
Apologies for "Does not work". I should have said, "Does not produce the
results I was anticipating".
If I understand you correctly, I should be able to fix my problem by
spelling out the field I am trying to specify, complete with query reference.
The circularity explanation is helpful.
However, in this instance, I am not getting Error#, I am getting the first
value of the field in the query.
But thank you, I will see if making that change allows me to return to the
formula I am trying to use.
r. howell wrote:
Wny is a textbox with control source AltWds not the same as one with control
source =[AltWds]?
What is =[AltWds] doing differently?
I don't ask because I particularly want to use this, but my formula wasn't
working and when I bring it down to this basic it still does not work.
Maybe somebody can explain to me the logic of the system. =[AltWds] appears
to be returning only the first value in the group, rather than the
appropriate value for each record.
:
I am developing a serious dislike for the phrase:
"does not work"
The difference is that the = sign invokes the expression
service to evaluate the expression. As part of its name
resolution process, the expression service uses control
names if they exist. Only if there is no control with that
name does it look for a field in the record source
table/query. Normally that's just the long way around to
get to the same thing, EXCEPT when there is control with
that name. In this case you will get the value of who knows
what if the control is bound to some other field or
expression. More commonly, the text box with =AltWds is
named AltWds which creates a circular reference. A circular
referenece will eventually produce #Error, which is not the
same as "does not work"!