VBA help

Thanks very much Gasman, that worked like a dream! You wouldn't have guessed how long I've spent trying to solve this, and I would never have worked this out by myself.
Look on Youtube. There are plenty of tutorials on Access.
I even have this book, amongst others. :)
 
is [NetTotal] a Calculated column, then use the Original Expression (used to derived NetTotal), and substitute it to your VAT expression.
 
Thanks arnelgp. I'm sorry, I just deleted my question, because I think I just realized why it wasn't working. I haven't perfectly solved it yet, but I'll try what you suggested. Many thanks.
 
Thanks arnelgp. I'm sorry, I just deleted my question, because I think I just realized why it wasn't working. I haven't perfectly solved it yet, but I'll try what you suggested. Many thanks.
In future, please don't delete a post that someone has responded to as members searching for answers in the future will be mystified. The thread makes no sense now.
 
I'm making progress, your suggestion did solve the "Enter Parameter Value" issue.

The next thing that is confusing me, is that when I run the query, I have almost three times as many rows as before. I'll just explain again what I'm try to achieve, because I deleted my post before.

So, I have grouped by player ID and engagement ID in a query, to get a sum per player per engagement. There are 363 results, and that seems to be correct.

When I enter this formula - Expr1: IIf([T_MusiciansDetails]![VAT_Number]<>"",[T_Payments]![Amount]*0.2,"") I get 922 results. I'm not sure why that is yet.

Edit...Bob, I deleted my post literally one minute after posting. arnelgp was so quick to reply that I didn't notice nor expect anyone to reply in that time. But I get your point though, I won't in future.
 
don't include it in Group, but instead as "Expression"
 
Many thanks arnelgp. I tried what you suggested just now, but when I try to run it I get a message pop up saying "You tried to execute a query that does not include the specified expression 'IIF(Not [T_MusiciansDetails]![VAT_Number] ="",[T_Payments]![Amount]*0.2 ,"")' as part of an aggregate function.
 
By the way, if it's relevant, I can see reason why I am getting more rows with the IIF statement. It is because it is separating the VAT players into their separate payment types (fee, travel etc). Obviously I don't want this to happen, but I'm not able to get it to work if I enter the IIF statement as an expression. Thanks in advance for any help.
 

Users who are viewing this thread

Back
Top Bottom