This may be above my pay grade but here goes.
I'd like to make Function (arg1 as currency, arg2 as currency)
In the code, I'd like to go through a table or query (Which ever is easier, I'll set it up that way) and get a sum of one of the fields. I only
want to include records that match arg1 and arg2, which are two other fields in the record.
More plainly, since this may not even be the best way, I have a procedure that is going to create a record in a table. A couple of the fields in the table need to be populated with currency data. I have a table (or query if need be) that has the info but it has to match certain criteria, and that criteria is located in fields other than the field I'm summing.
Another way of doing it that I think may be a thing, is to set up a query that asks for parameters that can be passed from code and then use the resulting sum in the code, but I have no idea how to do that either. I know how to set up the query but not the code to automate it.
Thank you