Results 1 to 11 of 11
  1. #1
    ylivne is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    7

    Enet to a report

    Hi
    I have a module I wrote. How can I add him as an event to the report?
    I want the module to run every time I open the report.

    Thanks


    Yael

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Reports have an Open event.

  3. #3
    ylivne is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    7

    Enet to a report

    Quote Originally Posted by RuralGuy View Post
    Reports have an Open event.
    yes, and when I write "call MyModule()" at the "On Open" field I receive a message that it is an unknown macro.
    How should I define my procedure?

    Yael

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can not call a module in Access but you can call a SubRoutine that resides within a standard module. The Sub must *not* be named the same as the module name.

  5. #5
    ylivne is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    7
    Quote Originally Posted by RuralGuy View Post
    You can not call a module in Access but you can call a SubRoutine that resides within a standard module. The Sub must *not* be named the same as the module name.
    I did call my sub routine (not the module), and I did give the routine a significant name.
    My procedure is defined in the module like that:
    Public Sub AllProducts()
    ...
    End Sub

    At the report properties, at the On Open event field I wrote:
    call AllProducts()
    and received a message telling me the macro AllProducts() is unknown.
    How should I define my procedure?

    Yael

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You need to use code. On the event tab, press the "..." button in the OnOpen row and select "code".

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    When you are done the OnOpen row should have [Event Procedure] in it.

  8. #8
    ylivne is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    7
    Quote Originally Posted by RuralGuy View Post
    When you are done the OnOpen row should have [Event Procedure] in it.

    Thanks, that is what I did not know.
    Now it is working!!!

    Have a great weekend.
    Yael

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That's excellent! You have a great weekend as well.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    BTW, is this thread ready for the Solved thread tool now?

  11. #11
    ylivne is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    7
    Yap

    I did not know about this tool...

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

Similar Threads

  1. Replies: 1
    Last Post: 02-02-2009, 05:52 AM
  2. Replies: 0
    Last Post: 10-24-2008, 11:20 AM
  3. report prints blank page at end of report
    By darrellx in forum Forms
    Replies: 0
    Last Post: 03-14-2006, 08:51 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