[AccessD] View PDF in Unbound Object Control

Robert Stewart rls at WeBeDb.com
Tue Dec 4 11:01:47 CST 2012


>All,


I would like to be able to view different document types in the 
unbound object control.
I have a table that gives me the UNC path to the file.  I have the 
extension of the file
as a separate field in the table where the UNC path is.  I have 
limited the query to
only PDF files.  In this case, there are only 2.  I want to be able 
to preview them in the
control and double click them to open them in a PDF reader.

The problem is that the SourceDoc property is being changed, but not refreshed.
Well, not to the point that the document is display in the object container.

Below is the code I am using:

Private Sub Form_Current()
     Me.OLEUnbound4.SourceDoc = ""
     Me.OLEUnbound4.SourceDoc = Me.txtFullPath
     Me.txtSourceDoc = Me.OLEUnbound4.SourceDoc
     Me.OLEUnbound4.Requery
     Me.Refresh
     Me.Repaint
End Sub

When I am on the first row, the value in SourceDoc is:
\\sithou-sqldev\ssis_working\PhotoSamples\Data_Mart_Extracts_Rpt.pdf
When I move to the second record, it is:
\\sithou-sqldev\ssis_working\PhotoSamples\RT-201208-18101-49113240.pdf

I am getting this from the third line of code where I get the value 
of SourceDoc
and display it on the screen.

I still see the first document in the object container and when i 
double-click on
it, I get the first document.

Any one have any ideas on how to make this work?





Robert L. Stewart

Any fool can write code that a computer can understand. Good 
programmers write code that humans can understand. --Martin Fowler

www.WeBeDb.com
www.DBGUIDesign.com
www.RLStewartPhotography.com  


More information about the AccessD mailing list