DoCmd.DeleteObject acReport

F

FreeWheel

Hi everyone !

I've got this code in an Access 2000 database project running with Access
2003 which will do as expected only if the "project properties display
protection password" is not set;

If dbs.AllReports.Count > 0 Then
For num = dbs.AllReports.Count To 1 Step -1
itemnum = num - 1
Set obj = dbs.AllReports(itemnum)
If obj.IsLoaded = False Then
DoCmd.DeleteObject acReport, obj.Name
Else
End If 'obj.IsLoaded
Next num
Else
End If 'AllReportsCount

What do I need to do in order to get the objects (in this case the reports)
deleted while the "project properties display protection password" is set ?
 
F

FreeWheel

Hi Alex,

The code runs perfectly well when the "project properties display protection
password" is not set. The code deletes all reports in the same database.
I guess I am looking for a way to reset the protection just ahead of the
loop and set it back on right after it. What instrinsinc Access parameter
should I flicker and how ?

Tks for your reply, I highly appreciate it.

A+
 
F

FreeWheel

Hi again Alex, more info for you;

When in the project window (VB), this password is reset via TOOLS - ACCESS
PROPERTIES - Protection Tab - "Lock project for viewing" box and blanked
password.


Hope this can help !
A+
 
F

FreeWheel

Hi Alex,

Thanks for the tip, I will try it. I will get back to you

..........This code is used in a self destruct process......
 
F

FreeWheel

Hi Alex,

That person will get a nice surprise after using it after a certain date !
He will be stuck having to give me a call.

A+
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top