Diagram Title (1 Viewer)

geralf

Registered User.
Local time
Today, 18:32
Joined
Nov 15, 2002
Messages
212
Hi!

Does anyone know how to reference the properties of an Access diagram object inside a form, for example the diagram title?

Thanks in advance
 

Mutdogus

Registered User.
Local time
Tomorrow, 02:32
Joined
Apr 12, 2005
Messages
48
Does this work for you? I haven't tested it.

I did a search in the help file within the VBA IDE for "diagram" and came up with the

Alldatabasediagrams collection. This code was there.
Code:
Sub AllDatabaseDiagrams()
    Dim obj As AccessObject, dbs As Object
    Set dbs = Application.CurrentData
    ' Search for open AccessObject objects in
    ' AllDatabaseDiagrams collection.
    For Each obj In dbs.AllDatabaseDiagrams
        If obj.IsLoaded = True Then
            ' Print name of obj.
            Debug.Print obj.Name
        End If
    Next obj
End Sub
 

Mutdogus

Registered User.
Local time
Tomorrow, 02:32
Joined
Apr 12, 2005
Messages
48
I just read this too. If you are in a .mdb you are out of luck.

Notes

The AllDatabaseDiagrams collection only contains AccessObject objects within a Microsoft Access project (.adp). A Microsoft Access database (.mdb) does not contain any database diagrams.
To list all open database diagrams in the project, use the IsLoaded property of each AccessObject object in the AllDatabaseDiagrams collection. You can then use the Name property of each individual AccessObject object to return the name of a database diagram.
 

geralf

Registered User.
Local time
Today, 18:32
Joined
Nov 15, 2002
Messages
212
Yes, I'm using a mdb file. The diagram is an object right? Should it not be any abailable properties somewhere? As a workaround I can use a textbox control in the form. It would be great to do this through the object though.

Thanks very much for your replies.
 

Users who are viewing this thread

Top Bottom