Reputation: 2142
In Access 2010 I am trying to use custom VBA functions in a calculated column. I get 'the expression cannot be used in a calculated column'.
Here are my steps:
Write the following code:
Public Function TestFunc() As String
TestFunc = "test"
End Function
Upvotes: 4
Views: 7637
Reputation: 8459
According to this guide, user-defined functions are not allowed in calculated column expressions. The relevant quote is in the "Read It" section:
Be aware that calculated fields cannot call user-defined functions, only built-in functions. In addition, you must supply all parameters for methods that you call, even if the parameters are optional.
Upvotes: 6