Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    USA
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need built-in function, not UDF

    I inherited a database that was originally created before Access had the Round function.

    The original designer created a UDF called Round that did not allow for entering the number of decimal points.

    I want to be able to use the built-in Round function in my VBA code, but an not sure how to reference it.

    I expected that it would be something like Application.Round() which did not work.

    Does anyone know the proper syntax for utilizing built-in functions?

    Thanks,

  2. #2
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    USA
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts
    SOLVED.

    I found the answer.

    The syntax is VBA.Math.Round()

  3. #3
    3 Star Lounger HiTechCoach's Avatar
    Join Date
    Sep 2011
    Location
    Oklahoma City, OK
    Posts
    200
    Thanks
    0
    Thanked 31 Times in 30 Posts
    WARNING: I would test it to be see if it does the same type of round. The Built-in Round (stated with Access 2000) uses the round-to-even logic. Is that what you want?

    Syntax

    The syntax for the Round function in MS Access is:

    Round ( expression, [ decimal_places ] )

    Parameters or Arguments

    expression
    A numeric expression that is to be rounded.
    decimal_places
    Optional. It is the number of decimal places to round the expression to. If this parameter is omitted, then the Round function will return an integer.

    Applies To

    The Round function can be used in the following versions of Microsoft Access:

    Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000

    Example:

    ? Round (210.67, 1)
    210.7
    Boyd Trimmell aka HiTechCoach (Access Information here)
    Microsoft MVP - Access Expert
    "If technology doesn't work for people, then it doesn't work."

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •