Hi -
I am creating a database of student 'Placement Incidents', and one request was that lecturers are able to add supporting attachments to the main PlacementIncident record.
I have FileCopy working to copy documents from the PC documents folder to the database’s attachment folder. It then adds the attachment URL to my database’s ‘Attachment’ table (full UNC, not a lettered drive). The data type in the attachment table (for the UNC) I’ve set as ‘Hyperlink’.
I have the Attachment table in a subform on a main record form (the main record can hold multiple attachments), so the various attachments can be viewed.
The problem is I don’t want to show the full long UNC in the subform, I want to hide that field, and have the Application.FollowHyperlink run from the attachment’s short name field: “FileName”, by using code :
“Application.FollowHyperlink Me.Inc_Att_Link”, where ‘Inc_Att_Link’ is the working clickable field in the table.
However, I get the debug error “‘Run-time error ‘490’. Cannot open the specified file.” when clicking the FileName in the form, but if I make the UNC field (Inc_Att_Link) visible in the subform and click that, it opens the attachment fine.
Have any of you come across this before - do you know why I can’t get the FileName on-click event to open the attachment UNC written in the field “Inc_Att_Link”?
I am creating a database of student 'Placement Incidents', and one request was that lecturers are able to add supporting attachments to the main PlacementIncident record.
I have FileCopy working to copy documents from the PC documents folder to the database’s attachment folder. It then adds the attachment URL to my database’s ‘Attachment’ table (full UNC, not a lettered drive). The data type in the attachment table (for the UNC) I’ve set as ‘Hyperlink’.
I have the Attachment table in a subform on a main record form (the main record can hold multiple attachments), so the various attachments can be viewed.
The problem is I don’t want to show the full long UNC in the subform, I want to hide that field, and have the Application.FollowHyperlink run from the attachment’s short name field: “FileName”, by using code :
“Application.FollowHyperlink Me.Inc_Att_Link”, where ‘Inc_Att_Link’ is the working clickable field in the table.
However, I get the debug error “‘Run-time error ‘490’. Cannot open the specified file.” when clicking the FileName in the form, but if I make the UNC field (Inc_Att_Link) visible in the subform and click that, it opens the attachment fine.
Have any of you come across this before - do you know why I can’t get the FileName on-click event to open the attachment UNC written in the field “Inc_Att_Link”?