+ Reply to Thread
Results 1 to 5 of 5

DoCmd.DeleteObject assistance needed

  1. #1
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    DoCmd.DeleteObject assistance needed

    I'm picking apart some very complicated database coding written about 5 years ago by someone who's left the company. When I say very complicated, what it does isn't complicated, the way it does it is.....for example, there are HUNDREDS of functions within the coding, some that do ridiculous things like put 15 lines of error trapping around a 1 line command and others that complete multiple different functions based on the variable passed to it by the calling process. This is made all the more complicated in that I'm not an Access developer, I'm an Excel VBA developer and am having to Google quite a lot of the commands I'm not familiar with.....once I've identified it's not a self created function the author is calling

    One such function uses the 'DoCmd.DeleteObject' to.....delete stuff. The code looks like this:

    Please Login or Register  to view this content.

    And I've just stumbled across one of the (many) calling processes, however, the sub it's being called from is supposed to be for compacting and backing up the database. The calling code is:

    Please Login or Register  to view this content.
    Need a little help here cos the MS-help page isn't being. I was under the impression that DoCmd.DeleteObject acTable.......is used for deleting tables. However, the calling code suggests it's being used now for deleting a compacted database file.

    Wtf?

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: DoCmd.DeleteObject assistance needed

    Hi,
    I don't see how that could work either. Have you tried commenting out the On Error Resume Next in the Sub to see if it actually is doing anything?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: DoCmd.DeleteObject assistance needed

    It just gives error 7874, can't find object.

    I'm currently of the opinion that the original author was either under the influence of some very strong painkillers or simply didn't realise this doesn't do what he intended it to do.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: DoCmd.DeleteObject assistance needed

    That's what I would have expected. I tend to agree with your assessment.

  5. #5
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: DoCmd.DeleteObject assistance needed

    Good lad. It's nice to know I'm not going insane.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Assistance needed with arrays
    By doctorcpu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2016, 10:25 AM
  2. Download and combine Multiple Basic HTML Pages into an Excel Workbook
    By bugpro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2016, 03:15 PM
  3. IF Statment Assistance Needed
    By Dhook in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-14-2014, 01:00 PM
  4. How to build a macro with DeleteObject to delete a table.
    By FLCRUCET in forum Access Tables & Databases
    Replies: 1
    Last Post: 03-31-2013, 06:30 PM
  5. HELP... Assistance needed Please!
    By MChase in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 09-23-2012, 11:08 AM
  6. V Lookup assistance Needed
    By jdk789 in forum Excel General
    Replies: 5
    Last Post: 09-05-2012, 04:47 AM
  7. VBA Assistance Needed
    By RalphB in forum Excel General
    Replies: 5
    Last Post: 02-22-2006, 02:20 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1