how to add an active X reference with code

S

sk

i know its hard to believe but sometimes our access application mdb becomes corrupt and we have to start with a new empty mdb... we import what we can from the bad mdb and restore the rest from backups... we then have to MANUALLY add references to all of the activeX...

question: is there a way to add these references programmaticly

sincere thanks for your consideration.
sk
 
T

Ted

I haven't done it before, but I from the little that I
have read on the subject I think that the following
should be possible.

You can add references programmatically using the
AddFromFile and AddFromGUID methods of the References
object, such as:

Dim ref As Reference
Set ref = References!Access
ref.AddFromFile "C:\WINNT\system32\scrrun.dll"

You could also use the references object to loop through
all of your current references and store them in a table,
so that you will have the list when you need to restore
them later.

Hope that helps.

-Ted
-----Original Message-----
i know its hard to believe but sometimes our access
application mdb becomes corrupt and we have to start with
a new empty mdb... we import what we can from the bad mdb
and restore the rest from backups... we then have to
MANUALLY add references to all of the activeX...
 

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