I've created a database for some gaskets here at work. I've got everything working that I need, but I can't seem to get the imagery right.
My problem starts here:
I have a Secondary Form that sorts the gaskets out of the Main Form by "TYPE ". The form consists of a ComboBox that has a pull down "TYPE" from a Table linked to the Main Table. The form also has a print preview button that shows a subform with all of the info from the main table of each record of that specific "TYPE" and a Print Button that prints those sorted records. They're all properly linked to appropriate Queries and Reports. I added another button to print .pdf images of each sorted record, and it worked with a simple query and the link to the phycial PDF location in another column under the Main Table, but the images print out really pixelated/grainy (good quality pdf's btw, from autocad), so I batch printed out some good .dwf files for each record to try that approach.
I removed the image box from my Main Form and replaced it with an ActiveX Autodesk DWF Viewer Control box. On my Main Form, where you view each Record individually, the .dwf turns out great. I wrote VBA to have it find the actual .dwf file in it's location, then linked it to all the buttons, etc on the Form. An almost identical code is not returning [PN] results on the Report:
Option Compare Database
Private Sub FindDWF2()
Dim Viewer As IAdPageViewer
Set Viewer = CEView2.Viewer
On Error GoTo NoPic
strpic2 = Me![PN]
strpic2 = "M:\Part Database\gasketdwgs\" & strpic2 & "-Model.dwf"
If strpic2 = "M:\Part Database\gasketdwgs\-Model.dwf" Then
strpic2 = "M:\Part Database\gasketdwgs\DWFTemplate-Model.dwf"
End If
drawpath.Caption = strpic2
Me.CEView2.SourcePath = strpic2
Exit Sub
NoPic:
strpic2 = NoPic
drawpath.Caption = strpic2
Me.CEView2.SourcePath = strpic2
End Sub
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo NoPic
Me.CEView2.SourcePath = "M:\Part Database\gasketdwgs\" & strpic2 & "-Model.dwf"
Exit Sub
NoPic:
Me.CEView2.SourcePath = NoPic
End Sub
(note, all of the gaskets are found by Part Number [PN] and have the tag "- Model" written after every part # on the physical .dwf path)
The result right now is "Path does not exist, Please verify the correct path was given. M:\Part Database\gasketdwgs\-Model.dwf", then gives me the appropriate number of blank white pages. Apparently, the FindDWF2 isn't finding the part number based on the query.
What I'm trying to do is do the same thing with the PDF files, but with DWFs. They don't seem to embed like the PDF's, but I think they'd turn out grainy too if I could. So, I put an ActiveX Autodesk DWF Viewer Control box in the appropriate report, got the Query lined up right and when I run the report, it gives me the appropriate number of ActiveX Autodesk DWF Viewer Control boxes, but only a gray box with the globe and colored arrows shows up (typical activex default image). I'm thinking I need VBA for the report similar to what I wrote for the main table, but I don't know how to link it to all appropriate sources.
Ideally, when i'm in the TYPE Sorting Form, I want to print the sorted .dwf records with a press of the button like I have with the text records. If there's an easier way than the way I'm going, I'm open for suggestions?