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+
"Alex Dybenko" wrote:
> Hi,
> you mean that is fails on DoCmd.DeleteObject acReport, obj.Name?
> Are you deleting reports in the same database or external one?
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
>
>
> "FreeWheel" <(E-Mail Removed)> wrote in message
> news:F6F5C187-7655-423C-A6BD-(E-Mail Removed)...
> > 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
> > ?
>
>