broken reference

J

john

Hi all,

an access application on a server is run
from two different computer.

On one of the machine it is working correctly

On the other a broken reference make the program stop.
(Because a driver is not installed and not needed)

To manually fix it i go in the reference menu and uncheck the
missing reference. the program can then be run and
the user can have access to the function he need.

Is there a way to uncheck a reference with vb

If i try ot uncheck the reference with vb where
the driver is not installed, i have an error
message like the item is not registered.

Please help

Regards, Pierre
 
D

Douglas J. Steele

The References collection has a Remove method. The following example, from
the Help file, shows how you'd remove a reference to MSCAL:

Function RemoveReference() As Boolean

Dim ref As Reference

On Error GoTo Error_RemoveReference
Set ref = References!MSACAL
' Remove calendar control reference.
References.Remove ref
RemoveReference = True

Exit_RemoveReference:
Exit Function

Error_RemoveReference:
MsgBox Err & ": " & Err.Description
RemoveReference = False
Resume Exit_RemoveReference
End Function

Depending on what the reference is, you might be able to switch to using
Late Binding, so that you don't need to set a reference. In that way, the
reference not being present wouldn't stop other code from running: it would
simply raise a trappable error when you tried to instantiate the reference.

You might also want to take a look at what MichKa has at
http://www.trigeminal.com/usenet/usenet026.asp
 

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