Lookup Function

  • Thread starter Thread starter constantaFotea
  • Start date Start date
C

constantaFotea

Hi,
I have a form with 2 controlls: "Zone" and "Weight".
I have also a table with 3 fields: "Zone", Weight"
and "Tarif". How I can (see, bring) on my form the Tarif
for a certain "Zone" and "Weight"? It is about a
transportation problem.
I suppose that I should use Lookup Function for two
criterias: "Zone" and "Weight". But how?
Thank you
Constanta
 
For a calculated textbox, you could try this as the control source.

=DLookup("Tarif", "MyTable", "Zone=" & [Zone] & " And Weight=" & [Weight])

where [Zone] and [Weight] are the names of the textboxes or fields on the
form that contain that data. If the textbox and its associated field both
have the same name, you may get an error. If so, change the name of the
textbox (i.e. if both named Zone, name the textbox txtZone).
 
Back
Top