G
Guest
I am having a major problem with expressions in a query and saving the
results. I have three tables so far in my data base named; tblChurchPmt,
tblPmtType, tblPercent. Each table has a primary key as follows:
tblChruchPmt- ChurchID, tblPmtType-PaymentID, tblPercent-LineID.
tblPmtType is used in a drop down box in tblChurchPmt to make selections as
follows: 1=PayPal, 2=Check. tblPercent is used for percentage fees and
surcharges from Pay Pal. I am using a table as these fees can change from
time to time and this way I would only have to change the figures in the
table and they would be changed in all of the expressions. There will only be
one record in tblPercent (1).
Each table has the primary key as an autonumber and each table has a field
named after the other tables primary keys as number.
I created a query from the tblChurchPmt and I have three fields named;
AmountPaid, FeeAmount, NetPayment. I also have entered the following
expressions
FeeAmount:iif([PaymentID]=1,[AmountPaid]*[PayPalPercentage]+[Surcharge],iif([PaymentID]=2,0))
NetPayment:AmountPaid-FeeAmount.
PaymentID is the primary key for either Pay Pal or Check from the drop down
box
PayPalPercentage is the percentage amount entered that I get from Pay Pal
Surcharge is the amount entered that I get from Pay Pal
Here are the two questions I am trying to get resolved:
1- Is there anyway that I can have the LineID from tblPercent enter
everytime I make a new entry? As it is now I have to enter the number 1
inorder for the expressions to work if I don't enter 1 a 0 is entered and the
results of the expressions are blank.
2- How can I save the results of the expressions to the table. I need to
save the Fee Amounts and the Net Payment in the table tblChurchPmt as these
amounts are needed for the reports I generate and are required for audits. As
these amounts change with the amount paid I have to have them saved in the
table.
Any help with this would be greatly appreciated. I would also like to ask
that you try to explain this to me in simple terms as my understanding of
Access is still limited so if you could give me good details that would be
great.
Thank you in advance
Bill_De
results. I have three tables so far in my data base named; tblChurchPmt,
tblPmtType, tblPercent. Each table has a primary key as follows:
tblChruchPmt- ChurchID, tblPmtType-PaymentID, tblPercent-LineID.
tblPmtType is used in a drop down box in tblChurchPmt to make selections as
follows: 1=PayPal, 2=Check. tblPercent is used for percentage fees and
surcharges from Pay Pal. I am using a table as these fees can change from
time to time and this way I would only have to change the figures in the
table and they would be changed in all of the expressions. There will only be
one record in tblPercent (1).
Each table has the primary key as an autonumber and each table has a field
named after the other tables primary keys as number.
I created a query from the tblChurchPmt and I have three fields named;
AmountPaid, FeeAmount, NetPayment. I also have entered the following
expressions
FeeAmount:iif([PaymentID]=1,[AmountPaid]*[PayPalPercentage]+[Surcharge],iif([PaymentID]=2,0))
NetPayment:AmountPaid-FeeAmount.
PaymentID is the primary key for either Pay Pal or Check from the drop down
box
PayPalPercentage is the percentage amount entered that I get from Pay Pal
Surcharge is the amount entered that I get from Pay Pal
Here are the two questions I am trying to get resolved:
1- Is there anyway that I can have the LineID from tblPercent enter
everytime I make a new entry? As it is now I have to enter the number 1
inorder for the expressions to work if I don't enter 1 a 0 is entered and the
results of the expressions are blank.
2- How can I save the results of the expressions to the table. I need to
save the Fee Amounts and the Net Payment in the table tblChurchPmt as these
amounts are needed for the reports I generate and are required for audits. As
these amounts change with the amount paid I have to have them saved in the
table.
Any help with this would be greatly appreciated. I would also like to ask
that you try to explain this to me in simple terms as my understanding of
Access is still limited so if you could give me good details that would be
great.
Thank you in advance
Bill_De