Results 1 to 5 of 5

Thread: Access VBA: How To: Implement User Function Code [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Resolved Access VBA: How To: Implement User Function Code [RESOLVED]

    Esteemed Forum Participants and Lurkers:
    ===============================
    Access 2003 VBA

    I'm a gutless wonder when it comes to Access (not to mention my gross disdain for the (in)capability of documenting??? an Access design!).

    I'm trying to implement a user function in an access database. For testing purposes, I have the following trivial "triple" code in module "User_Functions":
    Code:
    Option Compare Database
    
    Option Explicit
    Function triple(anInt As Integer) As Integer
        triple = anInt * 3
    End Function
    I can't seem to get this to work in a Report, or in a Query, or in a Table column (which is what I would really like to do!). My Report control looks like this:
    Code:
    TextBox:  Text4
    Control Source:  =triple(MSI_10_10!Code)
    When I try to open the Report in Print Preview, I get a popup asking "Enter Parameter Value" for "MSI_10_10" which is the name of my table. I don't want a parameter. I just want an output for each record which (for now) = (Code x 3). If I enter a value in this popup, such as "99", my Report shows "#Error" in the Text4 control for the 2 integer values for the Code in my MSI_10_10 table ... 12 & 34.
    Last edited by Webtest; Mar 22nd, 2006 at 10:38 AM. Reason: RESOLVED ... no thanks to MegaShaft
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

Posting Permissions

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



Click Here to Expand Forum to Full Width