PC Review


Reply
Thread Tools Rate Thread

DoCmd.DeleteObject acReport

 
 
FreeWheel
Guest
Posts: n/a
 
      9th Oct 2008
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 ?
 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      9th Oct 2008
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
> ?


 
Reply With Quote
 
FreeWheel
Guest
Posts: n/a
 
      10th Oct 2008
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
> > ?

>
>

 
Reply With Quote
 
FreeWheel
Guest
Posts: n/a
 
      10th Oct 2008
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+

"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
> > ?

>
>

 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      10th Oct 2008
Hi,
here a code to unprotect excel project, I think the same way you can do in
access.
http://www.mrexcel.com/archive2/61000/70611.htm

BTW, I think deleting reports in same DB is not a good idea, why do you
need this?

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


"FreeWheel" <(E-Mail Removed)> wrote in message
news:3857EE99-6082-444D-8E99-(E-Mail Removed)...
> 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+
>
> "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
>> > ?

>>
>>

 
Reply With Quote
 
FreeWheel
Guest
Posts: n/a
 
      11th Oct 2008
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......

"Alex Dybenko" wrote:

> Hi,
> here a code to unprotect excel project, I think the same way you can do in
> access.
> http://www.mrexcel.com/archive2/61000/70611.htm
>
> BTW, I think deleting reports in same DB is not a good idea, why do you
> need this?
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
>
> "FreeWheel" <(E-Mail Removed)> wrote in message
> news:3857EE99-6082-444D-8E99-(E-Mail Removed)...
> > 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+
> >
> > "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
> >> > ?
> >>
> >>

>

 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      11th Oct 2008
Hi,
self destruct process? but if somebody make a copy of it?

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


"FreeWheel" <(E-Mail Removed)> wrote in message
news:E52146F6-74D7-4E9A-A390-(E-Mail Removed)...
> 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......
>
> "Alex Dybenko" wrote:
>
>> Hi,
>> here a code to unprotect excel project, I think the same way you can do
>> in
>> access.
>> http://www.mrexcel.com/archive2/61000/70611.htm
>>
>> BTW, I think deleting reports in same DB is not a good idea, why do you
>> need this?
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>> http://accessblog.net
>> http://www.PointLtd.com
>>
>>
>> "FreeWheel" <(E-Mail Removed)> wrote in message
>> news:3857EE99-6082-444D-8E99-(E-Mail Removed)...
>> > 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+
>> >
>> > "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
>> >> > ?
>> >>
>> >>

>>

 
Reply With Quote
 
FreeWheel
Guest
Posts: n/a
 
      12th Oct 2008
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+

"Alex Dybenko" wrote:

> Hi,
> self destruct process? but if somebody make a copy of it?
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
>
> "FreeWheel" <(E-Mail Removed)> wrote in message
> news:E52146F6-74D7-4E9A-A390-(E-Mail Removed)...
> > 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......
> >
> > "Alex Dybenko" wrote:
> >
> >> Hi,
> >> here a code to unprotect excel project, I think the same way you can do
> >> in
> >> access.
> >> http://www.mrexcel.com/archive2/61000/70611.htm
> >>
> >> BTW, I think deleting reports in same DB is not a good idea, why do you
> >> need this?
> >>
> >> --
> >> Best regards,
> >> ___________
> >> Alex Dybenko (MVP)
> >> http://accessblog.net
> >> http://www.PointLtd.com
> >>
> >>
> >> "FreeWheel" <(E-Mail Removed)> wrote in message
> >> news:3857EE99-6082-444D-8E99-(E-Mail Removed)...
> >> > 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+
> >> >
> >> > "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
> >> >> > ?
> >> >>
> >> >>
> >>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DoCmd.OutputTo acReport, stDocName =?Utf-8?B?TWFyaw==?= Microsoft Access VBA Modules 3 13th Jan 2006 04:17 PM
Access 2000: Why does DoCmd.DeleteObject acReport error? =?Utf-8?B?QWRyaWFu?= Microsoft Access Reports 0 5th Oct 2005 12:36 PM
DoCmd.SendObject acReport Darren Spooner Microsoft Access Form Coding 1 18th Aug 2004 08:43 PM
Trouble with A2K DoCmd.Save acReport, sRptName david epsom dot com dot au Microsoft Access 0 29th Jun 2004 03:13 AM
DoCmd.Close and DoCmd.DeleteObject Daniel Magnus Bennét Björck Microsoft Access Form Coding 12 25th May 2004 08:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:51 PM.