Results 1 to 13 of 13
  1. #1
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131

    Procedure not calling in a sub form


    I found a procedure online to track changes to certain forms (an sudit trail). The audit trail works great but when I make the call using the before update in the sub form, it does not work, it works in the main form. I do not get an error but it does not write to the audit table. When I use the sub form just as a form, it works great. Any suggestions would be appreciated.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  3. #3
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131

    Stll not there.

    Quote Originally Posted by orange View Post
    In the post, it states that the procedure should be called form the before update on the on change event. Tried both with no luck and like I said, it works as a form but not a sub form.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    The thread mentions 3 audit trail routines. Which one are you using?

  5. #5
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    -Martin Green

    I looked at the other 2 but Mr. Green's worked the best for our application.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    But Mr Green's seems to have a problem with subform..
    I have not used any of these, but do follow the forum.

    Can you post a copy of your database that has the audit trail and some instructions to recreate the issue?

  7. #7
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    The database is rather large and contains sensitive so I am unable to upload it. But the code is the same as MR. Green's. I was going to show the subform and have users click an update button that would open a new form so the could make changes.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    PMFJI,

    You might also read this article:

    Creating an Audit Log
    by Allen Browne
    http://www.allenbrowne.com/AppAudit.html

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Mr Greens sample has 2 separate forms--not a subform.
    Can you dumb down a copy of your database--- use names like Donald Duck, Porky Pig, General Purpose etc.
    Cities can be Centerville, WestVille etc.

    Only need enough records to show the problem---I'm not interested in your sensitive data.
    Just the subform issue in context.

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Hi Steve,

    The other Audit Trail approach I saw and mentioned on one of the threads is by ScottGem

    I haven't tried it, but did find it in other forum so mentioned it in a post re Problems with Audit Trail and Subform.
    Do you use an Audit trail procedure in any of your production? If so, which one and do you have any advice re its use?

  11. #11
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I was asked to create an audit trail twice, IIRC (and a long time ago). This was for A97 & A2000 mdb format. At the time all I found was Allen Browne's site and have not looked into the process since.
    ScottGem is using data macros in (on??) the BE tables. Interesting, but seems limited. And I never use macros.... so......


    RE Allen's code. Again, this was a while ago.... I only had to track a few fields and modified the Audit code somewhat. But it appeared to work and they seemed happy with the reporting.

  12. #12
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Thanks Steve.

    My experience is with Adabas and Oracle where logging and rollback were options in transaction processing.

  13. #13
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Since no examples hard to say what could be wrong. Can you post the code or call you are using? But usually if you call something from a Subform, you need to reference the Mainform also so maybe check that. Also put a breakpoint in the code to see if it is even calling the procedure when you do it from Main/sub Form.

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

Similar Threads

  1. code error is calling a form
    By Jen0dorf in forum Access
    Replies: 2
    Last Post: 03-10-2016, 10:14 AM
  2. Replies: 33
    Last Post: 09-25-2015, 08:39 AM
  3. problem calling a form
    By markjkubicki in forum Programming
    Replies: 6
    Last Post: 08-15-2012, 08:27 PM
  4. Calling a Function From A Form.
    By ksmith in forum Access
    Replies: 2
    Last Post: 06-07-2012, 02:23 PM
  5. Calling up another form - Not Working
    By Buakaw in forum Forms
    Replies: 7
    Last Post: 02-26-2011, 06:49 AM

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