Results 1 to 3 of 3
  1. #1
    vicrauch is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Sacramento
    Posts
    27

    How to use a user written function as an event procedure


    I have two fields on one form that will both use the same procedure on AfterUpdate for either field. Is there some way to assign this one procedure to both fields AfterUpdate events? I know about [Event Procedure], but I'm talking about a separate routine.
    I have tried a function and a sub, but within the code module associated with the form, and I have tried both a function and a sub within a standard module, but none of these seem to work the way I'm doing it.
    Of course, if this is not possible, I can have each [Event Procedure] call my own procedure, but I was hoping there was a way to just call my procedure from the Event tab in the properties window.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Hi

    You may like to try this:

    = NameOfYourFunction()

    but you must use the brackets at the end of the function's name.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    vicrauch is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Sacramento
    Posts
    27
    Thanks Bob. I thought I had tried that combination too, but must have missed the equal sign "=" at the start with a function that was actually working.

    It works now.
    Vic

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

Similar Threads

  1. On-Click Event Procedure
    By tbassngal in forum Forms
    Replies: 6
    Last Post: 07-20-2011, 07:06 AM
  2. Replies: 1
    Last Post: 07-08-2011, 10:26 AM
  3. Replies: 4
    Last Post: 05-18-2011, 03:24 PM
  4. On Click Event Procedure
    By MrDean in forum Forms
    Replies: 3
    Last Post: 10-07-2009, 07:16 AM
  5. Troubleshoot NotInList Event Procedure
    By skyrise in forum Programming
    Replies: 4
    Last Post: 02-23-2009, 06:06 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