Results 1 to 6 of 6
  1. #1
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: 2465 Audit Errors after SP3 (Access 2002 SP3)

    Welcome to Woody's Lounge - based on your username I presume you must hail from the fair state of Nebraska. We hope you find the Lounge a useful resource.

    In the mean while, your error 2465 indicates that you are trying to apply a method to an object that it either doesn't know about, or cannot work with at the moment. You don't indicate which line the error occurs on, but I presume it is on the Me.Undo line. I should also add that the Me.NewRecord property isn't very reliable - I recently worked in a project that tried to use it and it gave us fits. In our case we were trying to do things to avoid using the Delete event, and were getting the 2465 error - we reverted to using the standard User Interface events and solved the problem that way. As far as I know, this isn't an issue associated with SP3 or Access 2002 - I also did a web search and found nothing, but of course that doesn't preclude it.
    Wendell

  2. #2
    New Lounger
    Join Date
    Jul 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    2465 Audit Errors after SP3 (Access 2002 SP3)

    I currently have Office XP SP3 installed. When I run the following code to cancel a record I get the error that follows.


    DoCmd.Hourglass True
    DoCmd.SetWarnings False

    If Me.NewRecord Then
    'This only works if the user has not saved the record or updated the subform which saves the record
    Me.Undo
    Else
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdDeleteRecord -This is the line with the error.
    'The on current event has made the 'new' record dirty - undo the record
    Me.Undo
    End If

    DoCmd.SetWarnings True
    DoCmd.Hourglass False

    DoCmd.Close acForm, Me.Name

    Exit_btn_Cancel_Click:
    Exit Sub

    Err_btn_Cancel_Click:
    MsgBox Err.Number & Err.Description
    Resume Exit_btn_Cancel_Click

    Error:

    2465 Audit Tracking tool can

  3. #3
    New Lounger
    Join Date
    Jul 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 2465 Audit Errors after SP3 (Access 2002 SP3)

    The line with the error is
    DoCmd.RunCommand acCmdDeleteRecord

    Thanks
    Pete

  4. #4
    New Lounger
    Join Date
    Jul 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 2465 Audit Errors after SP3 (Access 2002 SP3)

    I am also getting a similar error. Can you give an example of what you mean by "standard User Interface events"? I'd like to give it a try.

    Thanks!

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: 2465 Audit Errors after SP3 (Access 2002 SP3)

    Try this:
    <pre>If Me.NewRecord = True Then
    ' This only works if the user has not saved the record or updated the subform
    ' which saves the record
    Me.Undo
    Else
    ' If an existing record is dirty, undo the changes before deletion
    If Me.Dirty = True Then
    Me.Undo
    End If
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdDeleteRecord -This is the line with the error.
    End If</pre>

    Charlotte

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: 2465 Audit Errors after SP3 (Access 2002 SP3)

    Sorry, I was in a bit of haste and failed to see your comment on the error line. Without knowing the scenario, it's a bit difficult to determine what a better approach is. In general a record isn't added to a table until the user causes some sort of commit, whether at the form level, or if it's done in code. I presume in this situation you are using a bound form, in which case the record isn't saved until a user moves to another record or clicks a SAVE button of some sort - that's one of the areas where I prefer to let Access do it's thing. A Save button isn't generally necessary unless the form is unbound. The system I referred to that we were working with actually saved the record in code on one form with only a few fields filled in and then took you to a different form to complete the data entry task. Then they wanted the ability to delete a record after the fact if a person decided they wanted to back out. We redesigned it to a single form which made the whole process more efficient and eliminated many of the cases where a user subsequently wanted to delete a record. You don't indicate the event triggering your code, but if for example it was being run during the Delete event or the Before Insert event, you would get that kind of error.

    Finally, do you have a situation where it worked until you applied SP3, or are you doing new development and getting the error?
    Wendell

Posting Permissions

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