PSSMargaret
Registered User.
- Local time
- Yesterday, 20:07
- Joined
- Jul 23, 2016
- Messages
- 74
Hello all,
I am in need of assistance. I'm updating an old database. Each record in the database has a corresponding .pdf document that is saved in a folder outside of the database on a file server. A separate table in the database contains the location of the storage folder for all of the .PDF documents. The main form displays each record with a PDF image on the form that contains an OnClick event that will open the .PDF by using FollowHyperlink coding. The form contains an OnCurrent event that shows the PDF image if the document exists and will show a different image if the documents doesn't exists. Code below.
Each record may also have other associated documents besides the main document which are also stored in the same storage folder. The main form contains a continuous subform that lists the associated documents. As many of you will guess, I have been unsuccessful in getting similar code like the above to work for a continuous subform. After researching quite a bit, I have discovered that above won't work for a continuous form. I have also read that I could do something similar with a query and a textbox but I have also been unsuccessful with that as well. The associated document have a different numbering system than the main document so I have provided the directory patch and file criteria below.
If Dir([FileServer] & Format([ID], "\00000") & "-" & [ADNo] & ".pdf")
If anyone can assist, can you please confirm that the above technique cannot be done with a continuous form. If it can be done, the two command buttons for this form are:
cmdADpdf
cmdADpdfX
If this cannot be done on a continuous form, can you provide some guidance on how this can be done with a query. I'd like to return a "?" if the document doesn't exist and a PDF if the document does exists. I can then create a textbox from there.
Sorry this post is so long. I wanted to provide as much info as possible. Any assistance will be greatly appreciated.
Margaret
I am in need of assistance. I'm updating an old database. Each record in the database has a corresponding .pdf document that is saved in a folder outside of the database on a file server. A separate table in the database contains the location of the storage folder for all of the .PDF documents. The main form displays each record with a PDF image on the form that contains an OnClick event that will open the .PDF by using FollowHyperlink coding. The form contains an OnCurrent event that shows the PDF image if the document exists and will show a different image if the documents doesn't exists. Code below.
Code:
Private Sub Form_Current()
If Dir([FileServer] & Format([ID], "\00000") & ".pdf") = "" Then
Me.cmdpdfX.Visible = True
Me.cmdpdf.Visible = False
Else
Me.cmdpdfX.Visible = False
Me.cmdpdf.Visible = True
End If
End Sub
Each record may also have other associated documents besides the main document which are also stored in the same storage folder. The main form contains a continuous subform that lists the associated documents. As many of you will guess, I have been unsuccessful in getting similar code like the above to work for a continuous subform. After researching quite a bit, I have discovered that above won't work for a continuous form. I have also read that I could do something similar with a query and a textbox but I have also been unsuccessful with that as well. The associated document have a different numbering system than the main document so I have provided the directory patch and file criteria below.
If Dir([FileServer] & Format([ID], "\00000") & "-" & [ADNo] & ".pdf")
If anyone can assist, can you please confirm that the above technique cannot be done with a continuous form. If it can be done, the two command buttons for this form are:
cmdADpdf
cmdADpdfX
If this cannot be done on a continuous form, can you provide some guidance on how this can be done with a query. I'd like to return a "?" if the document doesn't exist and a PDF if the document does exists. I can then create a textbox from there.
Sorry this post is so long. I wanted to provide as much info as possible. Any assistance will be greatly appreciated.
Margaret