I MS Access 2013 I have a table tblContracts .In table I have a hyperlink field “FileLocation” where I store hyperlink to my pdf files.
On form I have a text box field where hyperlink is show in, hyperlink text is blue color and underlined .
If user click on hyperlink in text box it takes him to folder where file is located.
On click event of text box txtMyHyperlink I have:
It works fine if file exist, however if file is deleted I got error.
It would be good first to check if file exist in that location. However to check if file exists I have to use hyperlink path string that has # on both side something like: #\\somefoldername\somesubfolderName\filename#
It is interesting how hyprlink text looks like, at the end of path is file name however that file name do not have extension .pdf, just file name.
I can see all path if I use debug.print to check path variable.
Problem is if file is deleted and user click on hyperlink in form field then access throw error .
How to avoid this error that is long and confusing to user, instead gave user msg “File do not exist or file is moved to another location.