Getting values from another table

  • Thread starter Thread starter Mike Lang
  • Start date Start date
M

Mike Lang

This is an extremely basic question. I am trying to use a lookup to get
values from another table into my main data entry form. The other table has
2 fields - name and value. When I lookup name in my main form, I want the
form to be able to perform a calculation on the related value so if my
second table has values e.g.

Apples 1
Pears 2
Oranges 3

When I do a lookup on Pears, I want to be able to take the associated value
of 2 and perform a calculation on it. I just can't see how I get the
associated value into the form!

Thanks

Mike
 
Check into the DLookup function.

Syntax:

DLookup(expr, domain[, criteria])

VB help gives a good explanation of it.

John
 
The DLookup function is one way of displaying data from other than the
form's record source. Use:

=DLookup("myValue","myOtherTable","[criteria-here]")

as the control source of the textbox on your form.

-Ed
 
Had a little bit of trouble with syntax at first but got it working well -
tyvm!

Ed Robichaud said:
The DLookup function is one way of displaying data from other than the
form's record source. Use:

=DLookup("myValue","myOtherTable","[criteria-here]")

as the control source of the textbox on your form.

-Ed


Mike Lang said:
This is an extremely basic question. I am trying to use a lookup to get
values from another table into my main data entry form. The other table
has 2 fields - name and value. When I lookup name in my main form, I want
the form to be able to perform a calculation on the related value so if
my second table has values e.g.

Apples 1
Pears 2
Oranges 3

When I do a lookup on Pears, I want to be able to take the associated
value of 2 and perform a calculation on it. I just can't see how I get
the associated value into the form!

Thanks

Mike
 
Back
Top