Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6853745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:32:53+00:00 2026-05-27T01:32:53+00:00

In Access 2010 I am trying to use custom VBA functions in a calculated

  • 0

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:

  1. Launch Access 2010.
  2. Create a new database “DB”.
  3. Create a table “Table1” with a text column “Column1”. Create a test row with “hello” in Column1.
  4. On “Create” ribbon, click “Module” at the upper-right corner, which launches VBA editor.
  5. In VBA editor “Project” window, there are two projects “ACWZTOOL” and “DB”. Choose “DB” and select “Insert” -> “Module”.
  6. Write the following code:

    Public Function TestFunc() As String
        TestFunc = "test"
    End Function
    
  7. “Debug” -> “Compile DB” passed, “Save” and closed VBA editor. Now “Module1” appears in “Modules” tab in the left pane.
  8. In Table1, create a calculated column “Column2”, with expression “Len([Column1])”, the column works properly with the value in test row being 5.
  9. Change the expression to “TestFunc()”, the error pops up.
  10. I tried a few other built-in functions, it seems only the “basic” ones are supported in expression builder. E.g. “InStrRev()” is also not recognized.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:32:54+00:00Added an answer on May 27, 2026 at 1:32 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use a database I have in Access 2010 and trying to
I am trying to launch an existing MS Access database (Access 2010) from a
Delphi 2010 has a nice set of new file access functions in IOUtils.pas (I
I'm trying to use the Visual Studio 2010 Express editions to set up an
I am using cakephp. I am trying to use httpsocket to get information. <?php
i am trying to do a substring search from an access 2010 database in
I have trying to write a query in Access 2010. I have a table:
I am practicing VBA for Access 2010. I read all the suggested post regarding
In our organization we are trying to use EWS Managed API to access mailboxes
I am trying to see if you can use Microsoft Access Services, as available

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.