I'm really banging my head on this one

  • Thread starter Thread starter Mike Boozer
  • Start date Start date
M

Mike Boozer

Maybe this just can't be done. I have a hyperlink field on my form. PDF file
paths are inserted into it from scanned images. I set the deafult value for
the field as "View File". Otherwise the user would see file path and name in
the hyperlink field which could be confusing. Problem: Each record in the
database shows "View File" in the hyperlink field, whether or not an actual
PDF file path link was inserted. The way I see it, there are two options.
One is to have an image, say a little document icon, be visible if the "View
File" actually has a PDF file path inserted. If not, the icon would not
show. The second would be to have a default hyperlink going to a global PDF
document that basically says "No Document Available For Viewing" Any
thoughts? I posted this early this morning but I don't think I made myself
very clear. Apologize if this is considered a double post but I'm getting
very frustrated. Thanks.
 
Hi Mike,
I program my file viewing a little differently. I use one field, a text
field which stores the name of the file. I then store all documents,
pictures, etc. in one location, say C:\Pdf\ Now I use the forms current
event to "insert" the document, picture into the control created previously
from the menu command insert, object. Name the new control pdfDoc
To create the Field use the insert, object command from the menu, select
adobe acrobat document, and check the link checkbox. select any pdf document
to insert. adjust the size of the frame to your liking. Now use the
sourcedoc property of the control to set the path to the pdf file. I update
the sourcedoc on the forms on current event.

HTH

Here is the code I use:
Me.pdfDoc.Visible = False
Const path = "C:\Pdf\"
DIRVAL = Dir$(path & [FileName] & ".pdf")
If Not DIRVAL = "" Then
Me.pdfDoc.sourcedoc = path & DIRVAL
Me.pdfDoc.Visible = True
Else
' a generic pdf file that you wish to use when no document is assigned to
record
Me.pic_image.sourcedoc = path & "NODoc.pdf"
Me.pic_image.Visible = True
End If
 
Corrected from last post, sorry.
Bill Taylor said:
Hi Mike,
I program my file viewing a little differently. I use one field, {FileName] a text
field which stores the name of the file. I then store all documents,
pictures, etc. in one location, say C:\Pdf\ Now I use the forms current
event to "insert" the document, picture into the control created previously
from the menu command insert, object. Name the new control pdfDoc
To create the Field use the insert, object command from the menu, select
adobe acrobat document, and check the link checkbox. select any pdf document
to insert. adjust the size of the frame to your liking. Now use the
sourcedoc property of the control to set the path to the pdf file. I update
the sourcedoc on the forms on current event.

HTH

Here is the code I use:
Me.pdfDoc.Visible = False
Const path = "C:\Pdf\"
DIRVAL = Dir$(path & [FileName] & ".pdf")
If Not DIRVAL = "" Then
Me.pdfDoc.sourcedoc = path & DIRVAL
Me.pdfDoc.Visible = True
Else
' a generic pdf file that you wish to use when no document is assigned to
record
Me.pdfDoc.sourcedoc = path & "NODoc.pdf"
Me.pdfDoc.Visible = True
End If
Mike Boozer said:
Maybe this just can't be done. I have a hyperlink field on my form. PDF file
paths are inserted into it from scanned images. I set the deafult value for
the field as "View File". Otherwise the user would see file path and
name
in
the hyperlink field which could be confusing. Problem: Each record in the
database shows "View File" in the hyperlink field, whether or not an actual
PDF file path link was inserted. The way I see it, there are two options.
One is to have an image, say a little document icon, be visible if the "View
File" actually has a PDF file path inserted. If not, the icon would not
show. The second would be to have a default hyperlink going to a global PDF
document that basically says "No Document Available For Viewing" Any
thoughts? I posted this early this morning but I don't think I made myself
very clear. Apologize if this is considered a double post but I'm getting
very frustrated. Thanks.
 
Thanks a Million Bill. I just got back into the coding mood again and am
going to give your method a try. It sounds pretty slick. I'll post how it
worked out.
Bill Taylor said:
Corrected from last post, sorry.
Bill Taylor said:
Hi Mike,
I program my file viewing a little differently. I use one field, {FileName] a text
field which stores the name of the file. I then store all documents,
pictures, etc. in one location, say C:\Pdf\ Now I use the forms current
event to "insert" the document, picture into the control created previously
from the menu command insert, object. Name the new control pdfDoc
To create the Field use the insert, object command from the menu, select
adobe acrobat document, and check the link checkbox. select any pdf document
to insert. adjust the size of the frame to your liking. Now use the
sourcedoc property of the control to set the path to the pdf file. I update
the sourcedoc on the forms on current event.

HTH

Here is the code I use:
Me.pdfDoc.Visible = False
Const path = "C:\Pdf\"
DIRVAL = Dir$(path & [FileName] & ".pdf")
If Not DIRVAL = "" Then
Me.pdfDoc.sourcedoc = path & DIRVAL
Me.pdfDoc.Visible = True
Else
' a generic pdf file that you wish to use when no document is
assigned
to
record
Me.pdfDoc.sourcedoc = path & "NODoc.pdf"
Me.pdfDoc.Visible = True
End If
PDF
file value
for name global
PDF
 
Back
Top