Lock / Unlock VBA project

F

FreeWheel

HHHHHEEEELLLLLLPPPPPP anyone !

How do I Lock / Unlock my VBA project for viewing from a module within ?

I got this code in a Module which behaves properly only when the VBA project
lock for viewing is OFF.

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

I need to set the lock OFF ahead of this piece of code and back ON right
after it.
After spending too many evenings on the WEB searching....., I can only find
PASSWORD RECOVERY utilities which work but I do not need.... I need what's
inside !

What do I need to set / reset ?
 
A

AccessVandal via AccessMonster.com

But the code shows it is deleting your reports. Is that what you intend to do?
 
F

FreeWheel

Hi,

The application has many tables , very many reports and and forms so Access
won't complete the MDE conversion telling me there is too many table
reference IDs for it too handle.

Do you know of any patch for this limitation ?

Tks
 
F

FreeWheel

Hi,

Yes I did. I have also tried MDEing the modules, the forms and the reports
separately which works but then Access will not allow importing into one.....
I've got to find something.

Anymore ideas ?

Regards,
 
A

Alex Dybenko

Hi,
so do you mean that if you remove tables/queries - then you can compile to
MDE?
If this is really a reason - then I would try to make less objects (merging
modules into one/reviewing application) or moving some modules/forms into
separate library database, then you can add reference to it and use
code/forms same way like in the same MDB

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

FreeWheel

Hi Alex,

Finally SOLVED !
Code that won't compile will prevent MDEing and give this unrelated Table ID
error.
So I fixed a couple of undeclared variables.

However, If I may, would you give me a hint on how setting a reference to
an MDB as a library database ?

Tks
 
A

Alex Dybenko

Hi,
glad that you solved it, so it was undeclared variables, which prevented to
make MDE?

library MDB (MDE) - create ne mdb, import forms/modules from your app, which
you think can be used in other apps (or just which you like to have
separated), delete these modules/forms from original mdb, open any module,
tools-references and add reference to just created mdb file. Actually you
have to make MDE of it and add reference to library MDE in order to make MDE
from main MDB


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

FreeWheel

Thank you Alex, much appreciated !

Alex Dybenko said:
Hi,
glad that you solved it, so it was undeclared variables, which prevented to
make MDE?

library MDB (MDE) - create ne mdb, import forms/modules from your app, which
you think can be used in other apps (or just which you like to have
separated), delete these modules/forms from original mdb, open any module,
tools-references and add reference to just created mdb file. Actually you
have to make MDE of it and add reference to library MDE in order to make MDE
from main MDB


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

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