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

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

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.
 
Doug said:
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?


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.
 
Back
Top