Results 1 to 11 of 11
  1. #1
    tfulmer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Location
    Austin, Texas
    Posts
    19

    problems with "before update event"

    Hello
    I have searched the forum and have not had any luck finding a similarly related post and I hope someone can spare a moment to help out.
    (I am new at this stuff so the answer may be obvious to most of you.)



    I can't get a Before Update Event on a form to execute correctly in a function. The error I get is:
    "The expression BeforeUpdate you entered as the event property setting produced the following error: The object doesn't contain the Automation Object 'AuditTrail' "

    As part of my attempt to find out why, I opened up the mystical Northwind MDB, created an identical function, tried it out and it works fine.

    I used the documenter to compare properties of the forms in my mdb versus the Northwind MDB and didn't see any big show stoppers there.

    The only difference I can see is that in my mdb, On the Form properties, Event tab, Before Update line, I try to enter "AuditTrail()" and the system replaces what I type with "[AuditTrail]". In the Northwind MDB it doesn't replace what I type and keeps it as "Audit Trail()".

    Does anyone have an idea if the [ ] is causing the problem and if it is what property setting do I have to change or whatever to make it work?

    Thanks
    Tom in a very hot Austin, Texas

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I assume you have the "AuditTrail()" code in a standard module. That module must *not* be named "AuditTrail"! Anything else would be fine.

  3. #3
    tfulmer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Location
    Austin, Texas
    Posts
    19
    The module is named "Module1".

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would put =AuditTrail() in the event line. Do you have the "="?

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does this project compile without errors?

  6. #6
    tfulmer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Location
    Austin, Texas
    Posts
    19
    Thanks for looking at this.

    This is what I type in the event line:
    "=audittrail()"

    However, this is what the system automatically changes my typing to:
    "=[audittrail]"

    No matter what I do, I can't get the system to accept the "()" version rather than the "[]" version.

    I don't get an error message during compilation, only upon execution. I posted the exact error message in the original long winded post.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It is as if Access cannot find that function. Try *importing* your db into a fresh new db and see if the problem follows: http://www.btabdevelopment.com/ts/impnew

  8. #8
    tfulmer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Location
    Austin, Texas
    Posts
    19
    Good idea.

    I tried it but I still have the same problem.

    I will try building the entire mdb item by item and test it as I go along to see when the problem rears its ugly head.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Use Edit>Find and see how many AuditTrail you can find.

  10. #10
    tfulmer is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Location
    Austin, Texas
    Posts
    19
    Thank you for all of the help.

    Problem solved after rebuilding from scratch.

    I have no idea why the problem occurred, but it is gone.

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Some sort of corruption I'll bet. Thanks for posting back with your success.

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

Similar Threads

  1. "On Current" event and ActiveX controls
    By beru777 in forum Programming
    Replies: 7
    Last Post: 12-20-2011, 10:32 AM
  2. Replies: 7
    Last Post: 01-19-2011, 10:39 AM
  3. Replies: 12
    Last Post: 06-14-2010, 08:39 PM
  4. Replies: 5
    Last Post: 07-19-2009, 08:37 AM
  5. Replies: 21
    Last Post: 06-03-2009, 05:54 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