locked
Help deleting some report objects RRS feed

  • Question

  • I inherited a access 2003 db which I have converted to Access 2013.  One of the reports contains several unbound object frames which contain embedded  ole objects.  These objects are not being used and their visible property is set to false to hide them.  I want to clean it up and get rid of them, but when I select them and press the delete key, I get the message below and it doesn't delete.  How can I get around this and get rid of the objects?

    Friday, August 26, 2016 9:51 PM

Answers

  • I have have placed the following code in the reports on open event.

    DeleteControl "Manufacturing Labels", "Embedded142"

    The report name is "Manufacturing Labels"  The control name is "Embedded142".  When it runs I get this error.

    What am I doing wrong?

    Try the DeleteReportContol method instead of DeleteControl.  Regardless of what the help topic says, DeleteControl only works on forms.  Be aware that, for either of these methods, the object must be open in Design or Layout view.


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    • Marked as answer by tkosel Thursday, September 1, 2016 4:13 PM
    • Unmarked as answer by tkosel Thursday, September 1, 2016 4:17 PM
    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Tuesday, August 30, 2016 3:49 PM
  • Just for fun try opening it in Design view and then try running your command in the immediate window.

    -- Daniel Pineault, 2010-2015 Microsoft MVP Professional Support: http://www.cardaconsultants.com MS Access Tips and Code Samples: http://www.devhut.net

    • Marked as answer by tkosel Thursday, September 1, 2016 4:13 PM
    • Unmarked as answer by tkosel Thursday, September 1, 2016 4:16 PM
    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Thursday, September 1, 2016 3:14 PM
  • Just to make sure I understand the current situation, please verify that this is what happens:

      1. You open the report in Design view.
      2. You go to the Immediate Window in the VB Editor.
      3. You type this command: DeleteReportControl "Manufacturing Labels", "Embedded142"
          (or some corrected control name).

      4. You press the Enter key after typing the command.
      5. No error is raised.
      6. But the control named "Embedded142" (or whatever the corrected name was) remains on the report.

    That's odd.  Did you save the report after running the steps above?


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Thursday, September 1, 2016 4:56 PM
  • Daniel,

    Am not sure I know how to do this.  I know how to open the report in design view, but how do I get to the immediate window?  I used the database tools icon, then clicked on the visual basic editor Icon.  (Key strokes ALT F11)

    This is what I got.

    I forgot that I had changed the name of the control in my previous efforts.  I got the name right, and the command runs, but the control doesn't go away.




    • Marked as answer by tkosel Thursday, September 1, 2016 4:13 PM
    • Edited by tkosel Thursday, September 1, 2016 4:16 PM
    • Unmarked as answer by tkosel Thursday, September 1, 2016 4:16 PM
    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Thursday, September 1, 2016 4:04 PM

All replies

  • Hi. See if you can convert them into unbound OLE object by trying to delete what's in the Control Source( or whatever property dictates the control to be bound to an object) property. Just a thought...
    • Edited by .theDBguy Friday, August 26, 2016 9:55 PM
    Friday, August 26, 2016 9:54 PM
  • They are already unbound ole object frames, and there is nothing in the control source. 

    Friday, August 26, 2016 10:21 PM
  • Quite some time ago I was faced with a similar issue.  In the end, the only way to delete the control was through VBA.  Take a look at the DeleteControl Method.

    -- Daniel Pineault, 2010-2015 Microsoft MVP Professional Support: http://www.cardaconsultants.com MS Access Tips and Code Samples: http://www.devhut.net

    Friday, August 26, 2016 11:23 PM
  • They are already unbound ole object frames, and there is nothing in the control source. 

    Oops, sorry I missed it. Guess you'll have to try Daniel's suggestion. Good luck.

    Saturday, August 27, 2016 1:06 AM
  • I have have placed the following code in the reports on open event.

    DeleteControl "Manufacturing Labels", "Embedded142"

    The report name is "Manufacturing Labels"  The control name is "Embedded142".  When it runs I get this error.

    What am I doing wrong?

    Saturday, August 27, 2016 10:56 PM
  • Well, you don't miss much!  Glad to see that you might be human like the rest of us! 

    Saturday, August 27, 2016 10:59 PM
  • Hmm... Reading the link Daniel provided, I wonder if the method only applies to Forms. Just curious...
    Sunday, August 28, 2016 12:22 AM
  • Well, you don't miss much!  Glad to see that you might be human like the rest of us! 


    Actually, I'm not human. I'm an ogre. :)
    Sunday, August 28, 2016 12:23 AM
  • The Microsoft help references both forms and reports.

    Sunday, August 28, 2016 1:32 AM
  • The Microsoft help references both forms and reports.

    In that case, I would recommend using a custom function to open the report in design view before deleting the control. Just a thought...
    Sunday, August 28, 2016 2:28 AM
  • Hi tkosel,

    Based on this error message, it seems that some OLE controls are not registered correctly. For more information, I suggest you refer the link below:

    # ACC2000: 16-bit OLE Controls Not Supported in Access 2000

    https://support.microsoft.com/en-us/kb/208742

    For a workaround, I would suggest you move your Access database to previous computer, and delete the controls. Or you could create a virtual machine with original operating system and version of Office and Access database, and then remove all the OLE reference.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, August 29, 2016 3:02 AM
  • I have have placed the following code in the reports on open event.

    DeleteControl "Manufacturing Labels", "Embedded142"

    The report name is "Manufacturing Labels"  The control name is "Embedded142".  When it runs I get this error.

    What am I doing wrong?

    Try the DeleteReportContol method instead of DeleteControl.  Regardless of what the help topic says, DeleteControl only works on forms.  Be aware that, for either of these methods, the object must be open in Design or Layout view.


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    • Marked as answer by tkosel Thursday, September 1, 2016 4:13 PM
    • Unmarked as answer by tkosel Thursday, September 1, 2016 4:17 PM
    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Tuesday, August 30, 2016 3:49 PM
  • Dirk,

    As usual, thanks for your valuable advice.  I now have the following code in the on open event of the report.

    DeleteReportControl "Manufacturing Labels", "Embedded142"

    I am opening the report in layout view, but I still get the following.


    • Edited by tkosel Thursday, September 1, 2016 3:11 PM
    Thursday, September 1, 2016 3:09 PM
  • Just for fun try opening it in Design view and then try running your command in the immediate window.

    -- Daniel Pineault, 2010-2015 Microsoft MVP Professional Support: http://www.cardaconsultants.com MS Access Tips and Code Samples: http://www.devhut.net

    • Marked as answer by tkosel Thursday, September 1, 2016 4:13 PM
    • Unmarked as answer by tkosel Thursday, September 1, 2016 4:16 PM
    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Thursday, September 1, 2016 3:14 PM
  • Daniel,

    Am not sure I know how to do this.  I know how to open the report in design view, but how do I get to the immediate window?  I used the database tools icon, then clicked on the visual basic editor Icon.  (Key strokes ALT F11)

    This is what I got.

    I forgot that I had changed the name of the control in my previous efforts.  I got the name right, and the command runs, but the control doesn't go away.




    • Marked as answer by tkosel Thursday, September 1, 2016 4:13 PM
    • Edited by tkosel Thursday, September 1, 2016 4:16 PM
    • Unmarked as answer by tkosel Thursday, September 1, 2016 4:16 PM
    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Thursday, September 1, 2016 4:04 PM
  • Just to make sure I understand the current situation, please verify that this is what happens:

      1. You open the report in Design view.
      2. You go to the Immediate Window in the VB Editor.
      3. You type this command: DeleteReportControl "Manufacturing Labels", "Embedded142"
          (or some corrected control name).

      4. You press the Enter key after typing the command.
      5. No error is raised.
      6. But the control named "Embedded142" (or whatever the corrected name was) remains on the report.

    That's odd.  Did you save the report after running the steps above?


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    • Marked as answer by tkosel Thursday, September 1, 2016 6:12 PM
    Thursday, September 1, 2016 4:56 PM
  • Dirk,

    I did it again and it worked fine.  Don't know what I did the first time, but it worked now.  Thanks.

    Thursday, September 1, 2016 6:12 PM