you can't return a value from a query that way, unless the query is bound to
the form that the code is running from (in which case, all you'd need is the
field reference, as ruralguy pointed out).
if the query NameThings only returns one record, then you can retrieve the
value of the NameLOOK field with a DLookup() function as described by Doug
Steele, and assign it to Me.NameList; otherwise, you're going to need to
apply criteria in the DLookup() to retrieve the appropriate record from the
query.
hth
"accessdesigner" wrote in message
...
It's a query, and field name,... i was surprised too that i didnt work,
because it worked at work....
"Douglas J. Steele" wrote:
I'm surprised it recognizes that in any version.
What is NameThings?
If it's an open form, that should be Forms![NameThings]![NameLOOK]
If it's a table, you need to use a DLookup: DLookup("[NameLOOK]",
"[NameThings]")
If it's a recordset, you need to use NameThings!NameLOOK
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"accessdesigner" wrote in
message
...
I purchased a home version of Access from Microsoft through my job, and
when
I tried the following statement using the home version of Access, it
wont
recognize [NameThings.NameLOOK] as being correct, but it works at
work:
(why?)
Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If