Calling VBA Functions from Access SQL


  • How is this done ? How must the function be written and how does SQL recognize the function ?

    Saturday, November 17, 2007 8:17 PM

All replies

  • Hi

    You just write the function as a normal vba function and then use it as any other function eg sum() as Access will auto-recognise and call it.


    Function Multiply(val1 int, val2 int) as long
    Multiply = Val1*Val2
    End Function

    can be used as

    select Multiply(col1,col2) from mytable or within the design view in the select part.
    Monday, January 14, 2008 1:00 AM