One thing you might consider is putting the functions in a standard module
and passing the values from the form into them as their arguments. To take a
very simple example a function to calculate a gross price from a net price +
tax where the tax rate is a fractional value (e.g. 0.15 for 15%) in a control
on a form and the net price is a currency value in another control, so the
function would be like this:
Function GrossPrice(curNetprice as Currency, dblTaxRate as Double) As Currency
GrossPrice = curNetPrice * (1 + dblTaxRate)
End Function
You can then call the function in a query, or anywhere else for that matter
with:
GrossPrice(Forms!MyForm!NetPrice, Forms!MyForm!Taxrate)
Though more usually in a case like this the net price and tax rate would be
columns in the query, in which case they'd be passed into the function as its
arguments rather than referencing the open form. As you see the functions
can be far more generic in this way than when in a form's module, so can be
used in a variety of contexts in the database.
Ken Sheridan
Stafford, England