Hi John,
Thanks for the reply. I'll try to clarify.
I have a long text field in a table. A smaller text
field in another table.
I need to find all the records in the long text field,
that contain the small text field somewhere in it's
content.
So what work's for me, is if I do each manually, in an
access query. Using
like "*thespecifictextI'mlookingfor*", in the criteria
field, one record at a time for each entry in the smaller
text table. However I need a way to do this other than
one record at a time, hence I tried [TableName]![Field]
in the criteria field, it doesn't work.
For each match I'm need to return the long text field and
another field in the same table.
So I'm working with tables and queries.
I hope this clarifies what I'm talking about.
Todd
-----Original Message-----
Hi Todd,
You need to be clearer about what you mean by
[TableName]![Field]
If you want to get records that match a value from a
field in a record
from another table which is currently displayed on a
form, use something
like
Like "*" & [Forms]![XXX]![YYY] & "*"
where XXX is the name of the form and YYY the name of
the textbox
displaying the field (which is by default the same as
the name of the
field). (If this is in VBA code, you'll need to double
up some of the
quote marks.
If you want to get records that match a value from a
field in a
particular record in another table, you can use the
DLookup() function
to look up that record (based on the contents of one or
more other
fields) and return the value of the field. In that case
the query
expression would be something like
Like "*" & DLookup("FFF", "TTT", "KeyField = 99")
& "*"
where TTT is the name of the table, and FFF the field.
On Fri, 16 Jan 2004 14:24:20 -0800, "Todd"
<
[email protected]>
wrote:
I need to query a access table text field (100 char),
using a text field in another table (7 char).
I've a query using Like "*[TableName]![Field]*". But
it
doesn't work.
I'm sure it's easy.
Thank you.
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.
.