473,324 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Code to Launch website using Access 2007

So real newbie at coding. Have a form with field Hyperlink
Trying to get a button to launch said hyperlink but keep getting a runtime 8 error. Here's my code for the click button.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Toggle40_Click()
  2.     Dim strInput As String
  3.     strInput = Screen.ActiveForm![Hyperlink]
  4.     Application.FollowHyperlink strInput
  5.  
  6. End Sub
Apr 19 '20 #1
3 2869
cactusdata
214 Expert 128KB
This will work - if your button not is a toggle button and will be renamed to something meaningful:

Expand|Select|Wrap|Line Numbers
  1. Private Sub OpenHyperlink_Click()
  2.  
  3.     Dim Address As String
  4.  
  5.     Address = Me![Hyperlink].Hyperlink.Address
  6.     Application.FollowHyperlink Address
  7.  
  8. End Sub
Apr 19 '20 #2
NeoPa
32,556 Expert Mod 16PB
Hi AMoller.

This is complicated due to the lack of information that would be needed to help properly. I would assume that the following means you have a Control on the current Form named Hyperlink and that this control is probably a TextBox :
AMoller:
Have a form with field Hyperlink
That is probably the easy part.

AMoller:
Trying to get a button to launch said hyperlink but keep getting a runtime 8 error.
While error numbers are never a problem, they don't tell us much without having to go and look them up to find the text of the error message. Feel free to post the number as well, but it's always a good idea to include the text. In this case I was unable to determine any message for error #8 so completely in the dark :-(

AMoller:
Here's my code for the click button.
As far as the code goes there's nothing obviously wrong. However, the names raise questions.
  1. If it's a Command Button (CmdButton) control why is it named Toggle40? I suspect you've dragged a ToggleButton control onto your Form instead of a CmdButton. It's an easy mistake to make if you aren't very familiar with things.
  2. Access has a Hyperlink object. Be very careful with names of your own items (Forms / Controls / etc). They can lead people to misunderstand what it is you're trying to do. In this case I suspect the Control is actually a TextBox that happens to be called Hyperlink - as opposed to a Hyperlink control itself. I suspect that confused CactusData into giving that particular suggestion.
  3. An alternative to the code you have, after adjusting for using a (properly named) CmdButton instead of the existing Control, would be :
    Expand|Select|Wrap|Line Numbers
    1. Private Sub cmdLink_Click()
    2.     Call FollowHyperlink(Address:=Me.txtHyperlink.Text)
    3. End Sub
Let us know how you get on with this.
Apr 26 '20 #3
In the top left of the Access window and then click on the Access Options button. When the Access Options window appears, click on the Current Database tab. Then in the Display Form drop-down, select the forum that you wish to open at startup.
Apr 29 '20 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Hollywood | last post by:
Good day dear members of the comp.databases.ms-access newsgroup. Please I need your help on the following. I'm the administrator of an Access 2007 database. I would like my enterprise personnel...
1
by: Mientje | last post by:
I've made an Access 2007 database to store information about the lessonplans I have to make every schoolyear. I want to export the data form the table "Lesvoorbereiding" (Lessonplans in English) to...
2
DAF LAD
by: DAF LAD | last post by:
Hi. I have been running an access Database in Office 2003 for a while now. When I upgraded to Office 2007 one of my macro buttons has stopped working. The Button looks up to VBA code to Import...
3
by: brat33 | last post by:
I am trying to use a command button to automate a process for creating mailing labels from a query in Access 2007, going into word 2007. Current code looks like the following: 'Start MS Word Dim...
1
by: JMANTN | last post by:
I have data that sometimes needs to be uploaded to a 3rd party website and I’m trying to automate this process with Access 2007. I’m having a difficult time with my VBA syntax and with identifying...
0
by: cmcsween | last post by:
Will the Access 2007 runtime version run on machines with Windows 95, 98, and/or 2000 as the OS? Carol
0
by: Elaine Huseby | last post by:
I have a form "PartsAndInvoices that has all the parts in the database listed in split form view. I want the user to use Access 2007's filter section on the ribbon to choose mutiple filters....
2
by: kawprice60 | last post by:
I am a new user to Access 2007. I have to design a report that uses date prompts. My database has the following fields: date, total, under 30, service level I need to make a calculation on...
3
by: Jesukorede | last post by:
Hello, I am relatively new to access 2007.I am developing a database at present and need help on how to include a back up button with vba code that will back up the database when a user presses it.
2
by: walshm | last post by:
Good morning! I am working with Access 2007, creating a project tracking system for a group of Project Managers. For user interface, I'm using a series of forms. One of the forms includes text...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.