Expression Builder Help

T

ThomP

good morning to all,

I was asked to help with a problem.

we have 1 form (based on 1 table) and want to have 1 text box based on a
field in another table. Using this " = [Viable Tissues]![specimen comment]
" Where "Viable Tissue" is the name of the 2nd table and "specimen comment"
is the field.

we keep getting "#Name?" as a result. Any ideas?

thanks in advance
 
T

tkelley via AccessMonster.com

Not a lot of info, but if I understand correctly, you may want to check out
'DLookup' in the Access help.
good morning to all,

I was asked to help with a problem.

we have 1 form (based on 1 table) and want to have 1 text box based on a
field in another table. Using this " = [Viable Tissues]![specimen comment]
" Where "Viable Tissue" is the name of the 2nd table and "specimen comment"
is the field.

we keep getting "#Name?" as a result. Any ideas?

thanks in advance
 
T

ThomP

Thanks for the reply,

here is some more info, this might clear it up.

I have 1 form (Master) based on 1 table (Master).

On that form I need to add a "speciman comment" text box based on a field in
another table called "viable tissue" This is where I was using " =
[Viable Tissues]![specimen comment]

I tried the DLookup, but I am new at this and learning on the fly.

thanks for your help
--
thomp


tkelley via AccessMonster.com said:
Not a lot of info, but if I understand correctly, you may want to check out
'DLookup' in the Access help.
good morning to all,

I was asked to help with a problem.

we have 1 form (based on 1 table) and want to have 1 text box based on a
field in another table. Using this " = [Viable Tissues]![specimen comment]
" Where "Viable Tissue" is the name of the 2nd table and "specimen comment"
is the field.

we keep getting "#Name?" as a result. Any ideas?

thanks in advance
 
F

fredg

Thanks for the reply,

here is some more info, this might clear it up.

I have 1 form (Master) based on 1 table (Master).

On that form I need to add a "speciman comment" text box based on a field in
another table called "viable tissue" This is where I was using " =
[Viable Tissues]![specimen comment]

I tried the DLookup, but I am new at this and learning on the fly.

thanks for your help

re: I tried the DLookup, but I am new at this and learning on the
fly.

So why didn't you post the actual DLookUp expression you used so that
we don't have to guess what you tried?

DLookUp is the correct method to return a value from a table that is
not the recordsource for the form.

The syntax is
=DLookUp("[Name of Field to return]","[Name of table]","[Some criteria
field] = " & [Name of control on this form that contains the criteria
value]

The above assumes that [Some Criteria Field] is a Number datatype.
You can look up
Where clause + Restrict data to a subset of records
to learn how to write the Where clause for the various different
datatypes, i.e. Number, Text, DateTime.
 
T

ThomP

thanks for your help, everybody.

As i was working on this, somethings changed, so I ended up creating a new
querie and form and got to where I needed to be.

Thanks again.
--
thomp


fredg said:
Thanks for the reply,

here is some more info, this might clear it up.

I have 1 form (Master) based on 1 table (Master).

On that form I need to add a "speciman comment" text box based on a field in
another table called "viable tissue" This is where I was using " =
[Viable Tissues]![specimen comment]

I tried the DLookup, but I am new at this and learning on the fly.

thanks for your help

re: I tried the DLookup, but I am new at this and learning on the
fly.

So why didn't you post the actual DLookUp expression you used so that
we don't have to guess what you tried?

DLookUp is the correct method to return a value from a table that is
not the recordsource for the form.

The syntax is
=DLookUp("[Name of Field to return]","[Name of table]","[Some criteria
field] = " & [Name of control on this form that contains the criteria
value]

The above assumes that [Some Criteria Field] is a Number datatype.
You can look up
Where clause + Restrict data to a subset of records
to learn how to write the Where clause for the various different
datatypes, i.e. Number, Text, DateTime.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top