Populate field in form based on other values entered in form.

Populate field in form based on other values entered in form.

Post by Doug » Wed, 17 Dec 2003 01:50:28


I am trying to create a form that will be used to input
data. Based on the data entered in the following fields:
ship to state, ship from state, and ship via, I am trying
to populate a rate field. I have a second table that
contains the rate based on the above mentioned 3 fields.
The rate field will then be used in additional
calculations.

What is the easier way to accomplish this?

Thanks in advance for any help you can provide.
 
 
 

Populate field in form based on other values entered in form.

Post by Marshall B » Wed, 17 Dec 2003 02:49:31


Try using the DLookup function:

DLookup("[ratefield]", "ratetable", "[shiptostate] = """ &
Me.txtshoptostate & """ And [shpfromstate] = """ &
txtshpfromstate & """ And [shipvia] = " & carrierID)

I assumed the state fields are text fields and the shipvia
field is numeric. If that's not the case, add or remove the
extra quotes.
--
Marsh
MVP [MS Access]