graphExport is an object variable. This object variable has properties and methods the actual graph on the form does not have.
vendor was probably a field in the form's RecordSource for the original code.
The following works for me, no subform involved:
Code:
Private Sub ExpGrph_Click()
Dim graphExp As Object
Set graphExp = Me.Graph11
graphExp.Export "C:\images\Graph11.jpg", "jpeg"
End Sub
If you want the filename to be dynamically constructed based on some value in a field, then use the concatenation syntax. Must reference field of the form's RecordSource or name of textbox.
graphExp.Export "C:\yourfolderpath\" & Me.provider & ".jpg", "jpeg"
But this doesn't help your boss place the jpg images on PowerPoint slide. Copy/paste just might be easiest approach.
I tried to find a way to link PowerPoint graphs to Access data but apparently they must be based on Excel.