Problems deleting a form from another db

A

Andrew Brill

We've got this code, which I modified from a google groups search:

Private Sub DeleteOptions()
'No use if PC doesn't have a registered copy of Access 97
Dim accObj As New Access.Application
accObj.OpenCurrentDatabase "C:\MyApp\Data.mdb"
On Error Resume Next 'form may not exist
accObj.DoCmd.DeleteObject acForm, "Options"
On Error GoTo 0
accObj.CloseCurrentDatabase
End Sub



The problem is we install runtime Access with blank .srg files to stop it
messing with the users copy of access. This means that to all intents and
purposes, Access is not installed on computers where the user does not
already have a full version of it. This means it can't set the object
accobj without reporting an activex automation can't create object error.

Are there any other ways to delete an object in an external database?

Thanks.
 

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