How do I combine these queries?

G

Guest

I made 3 different tables because that's the only way I could get the correct
expressions in the controls.

The fields are the same in all the tables - FinAmount & Fee -

Table #1 (Named tblFee6) - FinAmount is 0.01 to 25.00 / Fee is 5.25%. In the
control I used the expression =FinAmount*.0525. In the AfterUpdate I put the
following:

Private Sub EndingBid_AfterUpdate()
FinalValueFee = DMax("Fee", "tblFee6", "FinAmount <= & Nz([EndingBid], 0))
End Sub

Table #2 (Named tblFee61) - FinAmount is 25.01 to 1,000.00 / Fee is .0275% +
$1.31. In the control I used the expression =FinAmount*.0275+1.31. In the
AfterUpdate I put the following:

Private Sub EndingBid_AfterUpdate()
FinalValueFee = DMax("Fee", "tblFee61", "FinAmount <= & Nz([EndingBid], 0))
End Sub

Table #3 (Named tblFee62) - FinAmount is 1,000.01 and up / Fee is .0150% +
$28.12. In the control I used the expression =FinAmount*.0150+28.12. In the
AfterUpdate I put the following:

Private Sub EndingBid_AfterUpdate()
FinalValueFee = DMax("Fee", "tblFee62", "FinAmount <= & Nz([EndingBid], 0))
End Sub

**************************************************

My question is how can I get all three of the AfterUpdates into one? Do I
even combine them into one or can I do three separate AfterUpdates on the
same EndingBid field?

Thanks,

Kathleen

P.S.
Allen ... I figured out what was wrong with the first AfterUpdate you helped
me with.
 
M

[MVP] S.Clark

Make a Public proc, in a Module, and call it from each of the local procs.
Pass the field name as a parameter.
 

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