How to delete a relationship from a back-end database in VBA

The back-end is Access 2007 and password protected.

I have done a lot of research on the web but so far nothing worked.

I would really appreciate a complete example function.

Thanks in advance.
Clive BeatonAccess DeveloperAsked:
Who is Participating?
sognoctConnect With a Mentor Commented:
the command is simple

CurrentDb.Relations.Delete "RelationName"
Clive BeatonAccess DeveloperAuthor Commented:
I had to modify it to get to the back-end:

   Dim db As DAO.Database
   Set db = OpenDatabase(strBackEndFull, False, False, "MS Access;PWD=p@$$w0rd")
   db.Relations.Delete "tblReportstblReportsFieldsSettings"
But other than that, it worked.

Thanks very much.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.