I apologize, but I'm not getting this...
Here's the corrected expression which is in the control source field of the
text box within the report header of my report.
=DLookUp("[CommunityName]","TBL-Commmunities","[Abbreviation]='" &
Me.AbbreviationBox & "'")
I understand the concept of where the info is coming from, but I still don't
understand the part behind the second equals sign, or this part:
..... '" & Me.AbbreviationBox & "'")
What's Me.AbbreviationBox mean and where does that come from (syntax-wise?)
"Abbreviation" is a field in the TBL-Communities table. When I used this in
the control source and run the report, I get a "enter parameter value" box
that asks me for "Me".
Thanks for trying to explain this to me!
KK
Dennis said:
First of all take the bracket ) off behind [CommunityName].
In English the statement is saying Get the community name from the
TBL-Communities table where the abbreviation matches the one you have typed
into the AbbreviationBox on your form.
e.g. if you typed FIN into the abbreviationbox, the DLookUp is
=DLookUp("[CommunityName]","TBL-Communities","[Abbreviation] = 'FIN'")
which should bring back 'Finance'
So basically the 3rd part of the DLookUp is like a SQL where clause without
the word where.
Hope this explains.
:
I was with you up until the second equal sign. Here's what I have so far:
=DLookUp("[CommunityName])","TBL-Communities","[Abbreviation] = '" &
Me.AbbreviationBox & "'")
I have used DLookup before, so the first part was familiar, but I don't know
what is after the second equal sign.
Can you clarify the second part of that expression? Thanks!
KK
:
Set the Department field control source property to
=DLookup("[FullName]","YourTable","[Abbreviation] = '" & Me.AbbreviationBox
& "'")
Substitute your field and table names above.
:
I built a report, and in a text box at the top I want to reference the
department that the report applies to. The title changes each time I run the
report based on the department that I am querying. So I added a "Department"
field to the title line.
However, I'd like to type in an abbreviation for the Department, i.e., FIN
for Finance, and I'd like the title to read the full name "Finance". I built
a table listing all abbreviations and all full names, but I don't know how to
link the two together so that when I type in the Abbreviation, the full names
comes up.
Thanks for any suggestions.
KK