Create Address in Access forms

J

Jonas

I am trying to create a web address in Access. I have a form that has
text boxes numbered 1-8. It is my intention to concatenate the text
in the text boxes to create address then use the followhyperlink
method. I can create the string that I need but I get an error when
the code gets to the followhyperlink method; runtime error 490 cannot
open the specified file.

The reason why I intend to concatenate the text in the text boxes is
to allow the user flexibility. Some portions of the address are going
to be static and others are going to depend on a value in a list box.
Here is an example. In JOffSec1 I have "http://finance.yahoo.com/q?
s=" and in JOffSec2 I have +[combo22]. I have a text box which
concatenates the contents of JOffSec1 and JOffSec2 this textbox is
called Text20. My code refers to Text20.

I am able to copy and paste the contents of Text20 into code and have
it work but I can't get the code to work when I refer to [Text20].

Is it possible to copy and paste a line into code on the fly? Is
there another solution for my problem?
 
J

John Nurick

If you have textboxes txt1, txt2, txt3 you can concatenate their
contents and attempt to activate the result as a URL by doing

Application.FollowHyperlink _
Me.txt1.Value & Me.txt2.Value & Me.txt3.Value

I am trying to create a web address in Access. I have a form that has
text boxes numbered 1-8. It is my intention to concatenate the text
in the text boxes to create address then use the followhyperlink
method. I can create the string that I need but I get an error when
the code gets to the followhyperlink method; runtime error 490 cannot
open the specified file.

The reason why I intend to concatenate the text in the text boxes is
to allow the user flexibility. Some portions of the address are going
to be static and others are going to depend on a value in a list box.
Here is an example. In JOffSec1 I have "http://finance.yahoo.com/q?
s=" and in JOffSec2 I have +[combo22]. I have a text box which
concatenates the contents of JOffSec1 and JOffSec2 this textbox is
called Text20. My code refers to Text20.

I am able to copy and paste the contents of Text20 into code and have
it work but I can't get the code to work when I refer to [Text20].

Is it possible to copy and paste a line into code on the fly? Is
there another solution for my problem?
 

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