• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

How do you write a custom function in access vb that is available in expression builder ?

I would like to write a function in vb that is easily accessible from expression builder for a given query.
ie.  if my function in access vb is called myFunc ()  and takes a string and reverses the letters.
I would like to call the function from expression builer like the built in functions - eg. left(dbcolum,3)  
Ideally i would like to call myFunc(dbcolumn) and this would return that field with the letters reversed.

The above is only and example - please dont tell me there is a built in function that reverseres strings.

Thanks in advance
1 Solution
You just need to make the function Public in a classic VBA module

Public Function StrReverse(strIn as string) as String
   'function code goes here
   StrReverse= 'computed string
End Function

Now you can use it in your SQL

Select StrReverse(yourcolumn) from yourtable

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now