Using Lookup field in a table to help calculate a Total

C

CPOconllo

OK fairly new at access so please bare with me.

I have a table that I am trying to add a querry to that gives me a total,
however that total needs to be based on a lookup colum selection.

the table has these fields in it
, Rate Type, Rate, Miles--------->here is where the querry for total would be
Flat/Per ---- -----

The look up colum in the table has 2 variable Flat and per the name of the
tab;e that the look up fields comes from is also called Rate Type, the Rate
and Miles Fields always have to be entered manualy, if the Rate Type Field is
"Flat" then miles needs not to be in equation as the total would equal the
rate, if the look up variable is "Per" then I need the Total colum to produce
the answer for rate*miles.

My difficulty in this is that the "Flat or Per" are never the same, so the
Rate and Miles they have to be entered manualy, I have tried the

Total: IIf([Rate Type].[Rate Type]="Flat",([Rate]*1),[Rate]*[MIles]), but
when I load into datasheet view a message pops up asking for value of [Rate
Type].[Rate Type] and then it will only give a total when both Rate and miles
have an entry.


I know long winded but I thought more detailed the easier would be for some
one to help me with this please
 

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