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

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.
 
M

Marshall Barton

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.
 

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