Results 1 to 6 of 6
  1. #1
    fekrinejat is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29

    Using my vba function in calculated field ..

    How to use user-defined function in a calculated data type in Access 2010
    access doesn't recognize my function in expression builder

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your UDF needs to be a Public procedure in a Standard Module that is not named the same as the function.

  3. #3
    fekrinejat is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29
    I usually write my function in module .. as you said my function definition would be something like :

    Public Function Test(Entry as Integer) As Integer
    Test = Entry * 2
    End Function

    but access still doesn't recognize my UDF ,

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    As far as I can tell, calculated field type cannot use a UDF.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you saying you have a field in a table that is calculated? Why? I would do all my calculations in a query.

  6. #6
    dtours is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2015
    Location
    Guelph, ON
    Posts
    6
    A Function (no "Public needed") that you have written in a standard module should show up the query grid using Expression Builder.
    Last edited by dtours; 04-07-2015 at 07:45 PM.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 02-13-2013, 10:15 AM
  2. Replies: 3
    Last Post: 04-18-2012, 07:10 AM
  3. User Calculated Function problem
    By FrustratedAlso in forum Programming
    Replies: 13
    Last Post: 04-05-2012, 05:38 PM
  4. Replies: 10
    Last Post: 11-05-2011, 11:41 AM
  5. Calculated field
    By nashr1928 in forum Forms
    Replies: 9
    Last Post: 08-01-2010, 01:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums