Control object at runtime

P

patrick p

I using a control object (Autodesk Express Viewer control)
to add an "image (dwf file)" to my report. I created the
following code based on MS Article 210100 to change the
SourcePath of the control for each record.

Function setSourcePath()
Dim strSourcePath As String
strSourcePath = Me.txtDwfName
Me.CAdViewer.SourcePath = "[Cadd_Library].[DWF_direct]"
Exit Function
End Function


The control object is name CAdViewer, txtDwfName is a text
box containg the image path from the field DWF_direct.
I've set this function to be implemented OnPrint, however
on print preview the control is blank.

I've test the control by directly putting the image path
in the SourcePath and it shows up, however it doesn't show
up in the print preview.

Any suggestions as to what I'm doing wrong.
 
S

SA

Pat:

Two things to try:

1.) Add a do events after the call to this function to let Access pause
briefly while it pulls in the image.
2.) Try moving the code to the On Format event, but be sure to wrap the
call between the following:

Detail_OnFormat( )

If FormatCount = 1
call your routine
End if

End Sub

This will cause the code to only run once regardless of how many times
Access needs to format the section. On Format occurs before On Print.
 

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