Results 1 to 8 of 8
  1. #1
    Join Date
    May 2012
    Posts
    4

    Red face Unanswered: Private Sub Form Error

    Hello All:

    I've been reading your helpful posts and finally decided to join this forum. By for it is indeed one of the most in depth I've found.

    Let me start by confessing that I'm winging a great deal concerning Access. I've taken the basic class, and have played round with some of the advanced VB Modules. So I know I don't know a lot.

    Here's my issue. I've designed a decent db to track sensitive info. I need to also be able to track who is making revisions. However everytime I input - Private Sub Form_BeforeUPdate (Cancel As Integer) 'Log the user details to the table Me!SystemUsername = User_FX Me!RecordChanged = Now() End sub

    I keep getting the Error Message - Microsoft Office can't find the object "Private Sub Form...

    Since the audit tracking needs to be confidential, I created a separate form, then included a sub form, yet I can't get the revision tracking to work.

    I'm just looking for the simplest way to track revisions in access.

    Can anyone help. I'm desperate.

  2. #2
    Join Date
    May 2012
    Posts
    4

    Private Sub Form Error - 2nd Request

    Hello All:

    I've been reading your helpful posts and finally decided to join this forum. By for it is indeed one of the most in depth I've found.

    Let me start by confessing that I'm winging a great deal concerning Access. I've taken the basic class, and have played round with some of the advanced VB Modules. So I know I don't know a lot.

    Here's my issue. I've designed a decent db to track sensitive info. I need to also be able to track who is making revisions. However everytime I input - Private Sub Form_BeforeUPdate (Cancel As Integer) 'Log the user details to the table Me!SystemUsername = User_FX Me!RecordChanged = Now() End sub

    I keep getting the Error Message - Microsoft Office can't find the object "Private Sub Form...

    Since the audit tracking needs to be confidential, I created a separate form, then included a sub form, yet I can't get the revision tracking to work.

    I'm just looking for the simplest way to track revisions in access.

    Can anyone help. I'm desperate.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you want to log whats going on then I'd suggest you write to an audit table any evbents you deem worthy of logging.

    there's plenty out there already. do a google for audit log / audit trail. IIRC Allan Browne's offering is pretty good

    if the logging is to have a possibly legal merit then you need to think very very carefully what you log, how you log it and whether the log can be tampered with

    as to what you log I'd always suggest you add the network logon of the user, the computer they are using and the system time. Access logon is worth near nothing. Using the newtwork API Calls for computername and userid identifies a specific computer and a specifric computer user id. if thats tied in with your computer user policies of never ever leaving your computer logged in unattended and so on you have the start of a good audit log.

    ideally have the audit log table tied down so that it can only be written to BUT not changed by most users. limit the number of users who have rights to change or delete data. use a sequence ID to identify rows so its possible to demonstrate that rows are not missing.

    Before now I've had an audit log running in a separate DB whose access is controlled by the network user groups.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    please do not start new threads for the same question. if you dont' get the response you were expecting or looking for then its perfectly acceptable to bump the the post. using say:-


    ***BUMP***

    however you may need to rethink your question, as to why you may not have had a response. usually most threads will get some response, but sometimes it doesn't happen. often thats because the question is vague, meaningless, or trust to tricky to fathom. contributors here do it for free they get nothing out of it so if your question is vague or it may take an inordinant amount if timke then its unlikely you'get a response unless it happens to tickle that persons interest.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Where, exactly, are you 'inputting'

    Private Sub Form_BeforeUPdate (Cancel As Integer) 'Log the user details to the table Me!SystemUsername = User_FX Me!RecordChanged = Now() End sub
    The Form_BeforeUpdate event is a standard event, part of every Access Form. It has to reside in the Form's Code Module, and will look something like this
    Code:
    Private Sub Form_BeforeUPdate (Cancel As Integer) 
    
    'Log the user details to the table 
    Me!SystemUsername = User_FX Me!RecordChanged = Now() 
    
    End sub
    Getting a message that Access cannot find it makes me wonder if you've tried placing it in one of the Property boxes in the Property Pane, in Form Design View.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    May 2012
    Posts
    4

    Thank You So Much!!!

    @ Healdem: I'm very new to this forum and was unaware of the bump. If you will leave me the instructions on how to bump i will of course comply. Thanks for the heads up. Also you are very right, I have been going to the form property sheet and pasting the code into the event box, with no luck. I think I will try the audit log route.

    @Missinglinq: I think your suggestion of using a tracking log is probably the easiest route for me to take. I will go online a look for the steps to do just that. Thanks so very much!

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by naughtie View Post
    @Missinglinq: I think your suggestion of using a tracking log is probably the easiest route for me to take. I will go online a look for the steps to do just that. Thanks so very much!
    Actually, that was Healdem's suggestion! Here's a link to Allen Browne's excellent step-by-step for doing creating a log:

    Allen Browne - Creating an Audit Log

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    Join Date
    May 2012
    Posts
    4

    Smile Healdem - Much Thanks!

    @Healdem: Please forgive my previous error. I have taken your suggestion and am reading over Allen Browne's instructions. I'm obviously dumb as dishwater, as evident by thanking the wrong person for your advice. My sincerest appologies and gratitude.

Tags for this Thread

Posting Permissions

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