1 Attachment(s)
[Access] Controlling an unbound Excel Graph object
I am trying to plot a graph where the x value is based on the year and y is on production values. All the graphs in the serises will have different timelines. What I want to do now is to place a vertical line that I can control on the graph. See figure 1. The problem is I can't seam to figure out how to move this line in the Detail_format sub. Below is the code that I have tried but it still doesn't work:
code Code:
Dim objgraph As Object
Dim objaxis As Object
Dim objline As Object
Set objgraph = Me![Graph1]
Set objaxis = objgraph.Axes(1)
objline = objgraph.Shapes("line 1") 'gives me an error here. This is what I would like to change.
objline.Left = 5 'never moves to this point
With objaxis
t = (varLastDate - varFirstDate) / 365 - (newd - firstoyear) / 365
.MinimumScale = 0
t = (varLastDate - varFirstDate) / 365
.MaximumScale = t
leftr = .Left
righter = .Width
End With
Note: I have also tried just drawing a line on the report itself and properly moving it from left to right. The problem is the Excel graph appears to be in some units different then twips. Also, the zoom feature seams to be screwing up the graph.