Hi Richard, I appreciate your video on getting a value from a subform and it was very helpful, thank you. I have an allowed credit limit box on my customer form and a Sum(ExtPrice) in the footer of the Order sub form. I would like to have the amount for each order reflected in the Order subfom reduce the credit limit number on the customer form after each transaction. Is there a way to do that? I am uploading images hopefully to make this more clear.
The screenshot below shows how I would do it. I have a second field showing the Available Credit. You don't want to change the Credit Limit itself.
Kevin Robertson 10 months ago
Roger Strate 10 months ago
I created two fields one for available credit using the DSum function and one called total orders. I followed your instructions for the IIF function it follows: =IIF ([TotalOrders]) = 0, [CreditLimit], [CreditLimit]-DSum("SumOrderTotal","CustomerOrderTotalQ","CustomerID=" & ([CustomerID]))). I get the error message "wrong number of arguments. Any ideas?
Roger Strate 10 months ago
I like the IIF function for this field but I tried Alex' suggestion and it works great. Kevin thank you, if you figure out the IIF function for me I will use it. Thank you Alex as well.
Kevin Robertson 10 months ago
You have an extra parenthesis after [TotalOrders].
=IIF ([TotalOrders] = 0, [CreditLimit], [CreditLimit]-DSum("SumOrderTotal","CustomerOrderTotalQ","CustomerID=" & ([CustomerID])))