Results 1 to 4 of 4
  1. #1
    Harley Guy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    57

    "The object doesn't contain the automation object 'ArchiveCurrentAudit'

    I am attempting to do a run code macro in a form and I keep getting this error message when ever I attmept to launch it.

    I click OK on the error message and a box comes up to halt the macro with this information:

    Macro Name:
    Archive Current Audit
    Condition:
    True
    Action Name:


    Run Code
    Arguemnts:
    RenameTable_Click(ArchiveCurrentAudit)

    I halt the macro and this message comes up:
    The object doesn't contain the Automation object 'ArchiveCurrentAudit'

    Below is the coding that is being run...I can run it from the module I have set up for it but I would like to have users click on a command button, enter in a new name of a table to archive it so that a new one can be created. Once the user has renamed the table, I'd like to have them come back to the form. Any ideas?

    Public Function RenameTable_Click(ArchiveCurrentAudit)
    On Error GoTo Err_ErrorHandler
    Dim strTable As String
    strTable = InputBox("Please enter the new table name.", "Table Name")
    If strTable = vbNullString Then
    MsgBox "No table name entered.", vbExclamation
    Else
    DoCmd.Rename strTable, acTable, "Server List"
    MsgBox "Table successfully renamed.", vbInformation
    End If
    Exit_ErrorHandler:
    strTable = vbNullString
    Exit Function
    Err_ErrorHandler:
    MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
    Resume Exit_ErrorHandler
    End Function

    I am a novice at coding...just starting to learn on my own. I am going to take some classes to get better at this but right now, I have a project I need to compelte that is related to the use of this database.

    Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What is "ArchiveCurrentAudit"? Your function wants it as a parameter but doesn't use it. Your call to the function includes it, but perhaps it doesn't actually exist anywhere, hence the error. You might try changing these lines to exclude it:

    Public Function RenameTable_Click()

    RenameTable_Click()
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Harley Guy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    57
    Yeah baby...Thanks Baldy, that did the trick!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. runtime error "Object Not Set"
    By specauto in forum Access
    Replies: 1
    Last Post: 08-22-2010, 12:12 PM
  2. Replies: 1
    Last Post: 08-05-2010, 12:11 PM
  3. Replies: 0
    Last Post: 03-04-2010, 06:32 PM
  4. "doCmd - can't find object"
    By drmcfall in forum Access
    Replies: 1
    Last Post: 08-18-2009, 09:41 PM
  5. Object required
    By duckie10 in forum Access
    Replies: 1
    Last Post: 05-15-2009, 02:11 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