Changing Hyperlink Error

basicuser

New member
Local time
Today, 01:57
Joined
Nov 4, 2009
Messages
4
Hi,

I am currently using a simple button in a Form with an onclick command:

Code:
Private Sub Command1187_Click()
Application.FollowHyperlink [Drawing]
End Sub

[Drawing] is a field in my form with the correct file path that enables the user to browse to an image stored in my database route directory.

It currently works well, however if there is no file present the user is displayed with an unhelpfull 490 Runtime Error.

Is there a way for me to change this so the error box displays a more helpful message simlar to "There is no image stored for this product."

Thank you in advance for your help.

Andrew
 
vbaInet

Thanks for the reply, I have tried the above code and read the articles but it seems to always return that the location is empty, even when it is not.

I would be grateful for some advice.

Andrew
 
It's either the file path is incomplete or incorrect or the reference to [Drawing] is incorrect.

What does the msgbox return for this:

Msgbox nz(Me![Drawing], "It's Null")
 
vbaInet thanks for the reply and sorry for it taking so long to get back to you,

The reply is "Drawing\001.pdf" if the file that I am looking for is 001.

Regards

Andrew
 
You need to be storing the complete drive\path\file. X:\Drawing\001.pdf
 

Users who are viewing this thread

Back
Top Bottom