I have inherited an Access 2000 database that has a text box where you click on a file path that is already entered there and it is suppose to bring up a Word or Adobe file.

Sometimes the file will open and other times Adobe will open and the document will flash on the screen and then Adobe closes. If the document will not open then I get a Runtime Error '490'. I have verified that the files exist and that the users have permissions to the files.

I'm not all that familiar with VB, so can someone tell me if the code below is causing the problem? If so, what can I do to fix it.

Private Sub form_location_Click()
'follow Hyperlink to form location
    If Me.form_location = "" _
     Or IsNull(Me.form_location) _
      Then
Else
Application.FollowHyperlink Me.form_location
End If
End Sub

Thanks,
Tiregal06 :lol:

There are a ton of reasons why this can/would happen. Runtime Error 490 is inability to open the specified file.... it doesn't really give a reason, but for some reason it failed. Application.FollowHyperlink Me.form_location is the line that it would have flipped out on, the problem, however, is that there is nothing wrong with the code..... Application.FollowHyperlink is generating the error. When you call the FollowHyperlink method, it tries to do it's thing, and fails. I'm guessing that maybe there is still a copy of Adobe open, hiding in the background, or windowless.... maybe an object reference to it is still active.... without the actual document in question here (the database AND the external file) it makes it a lot more difficult to tell.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.