Hi, I need some help in Microsoft Access 2003. I have a form that displays search results of products and one of the result fields is a web page that corresponds specifically to that product. How can I create a button that when clicked, will open up the resulting web address? Thanks!
Put this code on the OnClick event of your button. (Replace "YourFieldName" with the name of the field that is storing the web address. My example assumes that your data would be like google.com. My code will add the http://www. for you. If you are storing the http://www. in your data you can remove it from the code. )
Application.FollowHyperlink "http://www" & Me.YourFieldName, , True
The "True" part of the code says to open a new internet window. You can change that to False if you prefer. Try it.
You can also put this code on the click or double click event of the field that is storing the web address. Display the data as a the typical blue underlined hyperlink and then you can skip the button completely.
09.July, 2010 um 1:03 pm
Put this code on the OnClick event of your button. (Replace "YourFieldName" with the name of the field that is storing the web address. My example assumes that your data would be like google.com. My code will add the http://www. for you. If you are storing the http://www. in your data you can remove it from the code. )
Application.FollowHyperlink "http://www" & Me.YourFieldName, , True
The "True" part of the code says to open a new internet window. You can change that to False if you prefer. Try it.
You can also put this code on the click or double click event of the field that is storing the web address. Display the data as a the typical blue underlined hyperlink and then you can skip the button completely.
References :