hyperlinks driving me crazy

K

Katie

I've read many of the posts on here about hyperlinks and command buttons but
still don't know what problem I'm having with mine. I created a practice
database so that i don't mess up anything in the real one.

Here goes: I have one table called Table1. Table1 has one field called link
which is a hyperlink field. I have one record that's link field is
www.microsoft.com. I have one form called Form1. Form1 has a command button
called Command0 and a text box called Text1 that is linked to <link>.
Command0's OnClick event looks like this:

Private Sub Command0_Click()
Application.Followhyperlink Me.Text1
End Sub

I also tried:

Private Sub Command0_Click()
Application.Followhyperlink Me.link
End Sub

I can click on the hyperlink inside Text1 and it works. When I click on
Command0, though, I get an error stating
"Run-time error '490':
Cannot open the specified file."

What is the problem? I have looked everwhere and can not figure it out. I'd
be so thankful for any help anyone can give me.

Katie
 
A

Albert D. Kallal

If you make the field a hyperlink, then you don't need any code..and just
click on the eh field..

Fro the most part, I would avoid using actual hyper link fields, especially
if you need easy editing of
the data in a form.

So, just use plain text fields...and the your code as
Application.Followhyperlink Me.Text1

will work just fine.

It really is a question of deciding to make a field plain text, and use the
above code, or making the field an actual hyperlink field, and not writing
code to launch the link (but, then simple editing of the field is a pain).

I would just use plain text fields..and use your buttion code...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top