Expression won't work unless specific field is fille in

B

Bill_De

The expression I am using in a query is not working. The expression I
have will not work unless I enter the primary key from the table I have for
fees from pay pal. If I don't enter the number 1 in the field LineID the
expression returns blank, If I enter 1 then the expression does the
calculations I need correctly.

Is there any way to either get the lineID to fill in automaticaly, or can I
rewrite the expression so it will run without having to have the primary
field/ LineID number entered in the table/query. The exression I am using now
is:
FeeAmount:iif([PaymentID]=1,[AmountPaid]*[PayPalPercentage]+[Surcharge],iif([PaymentID]=2,0))

FeeAmount is the amount of all fees charged by Pay Pal based on the amount
paid by an individual for example Amount paid
$175*Percentage(2.9%)-surcharge($.31)

PaymentID is the primary field from a table tblpmtMethod 1=PayPal, 2=Check

Surcharge is an additional amount charged by Pay Pal

PayPalPercentage is the percent amount I get from Pay pal subject to change
currently at 2.9% (0.029) and the surcharge is $0.31 per transaction. LineID
is the primary key autonumber in the table tblpercent. I use this table as
the percentages and surcharge can change and this way I won't have to go into
multiple expressions and make changes it will be done automaticaly based on
the table tblpercent.

Please advise on how I can either enter the LineID automatically or what I
need to change in the expression to make it work without needing the LineID.

Thanks
Bill_De
 

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