How to open a URL via Firefox in access form (1 Viewer)

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
Hey guys,


I know I posted a similar question about opening in chrome but I need another form which opens that set of URLs in Firefox so wondering how this is done.
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:48
Joined
Sep 21, 2011
Messages
14,319
Use Shell() for your non default browsers?
Any hyperlink will open with your default browser.
Can use Shell for Chrome as well, if not a hyperlink.

Of course, then there is Google

Edit: for the FollowHyperlink, if a url, you need to prefix with the http:// or relevant prefix if not present.
 
Last edited:

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
Use Shell() for your non default browsers?
Any hyperlink will open with your default browser.
Can use Shell for Chrome as well, if not a hyperlink.

Of course, then there is Google
The box the user will click will need to reference a URL box and it will be different for each record but not sure how I can get that to work
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
Use Shell() for your non default browsers?
Any hyperlink will open with your default browser.
Can use Shell for Chrome as well, if not a hyperlink.

Of course, then there is Google

Edit: for the FollowHyperlink, if a url, you need to prefix with the http:// or relevant prefix if not present.
My first problem is I can't seem to get a link box working where it works based on the URL in the record not just one URL
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:48
Joined
Sep 21, 2011
Messages
14,319
Just refer to the control where the url is located.
Research each command I mentioned, depending on whether you want your default browser to open the url or not.
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
Just refer to the control where the url is located.
Research each command I mentioned, depending on whether you want your default browser to open the url or not.
I am confused do u have an example please
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:48
Joined
Sep 21, 2011
Messages
14,319
For Firefox
Code:
Shell ("Path to your Firefox exe" & " " & Me.txtUrl)
For default browser
Code:
Application.FollowHyperlink "http://" & Me.txtUrl

All typed outside of Access. You only need the http:// if it is not present in the control, eg www.bbc.co.uk
All can be tested in the Immediate Window with a hardcoded url, as Me.txtUrl is the control holding the url for each record.
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
Code:
Option Compare Database

Private Sub Command54_Click()
Application.FollowHyperlink "http://" & Me.txtUrl
End Sub

is this correct mate as I can't seem to get it working with the button
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:48
Joined
Sep 21, 2011
Messages
14,319
Code:
Option Compare Database

Private Sub Command54_Click()
Application.FollowHyperlink "http://" & Me.txtUrl
End Sub

is this correct mate as I can't seem to get it working with the button
Yes, that should work, depending on what is in txtUrl. Is the control even called that, as that was my name that I gave to the control, not knowing what you called yours? :(
As well as Option Compare Database, make sure you have Option Explicit on every module.

Put it all into a string variable, then you can debug.print it, and copy the output, and post it back here for viewing.
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
Yes, that should work, depending on what is in txtUrl. Is the control even called that, as that was my name that I gave to the control, not knowing what you called yours? :(
As well as Option Compare Database, make sure you have Option Explicit on every module.

Put it all into a string variable, then you can debug.print it, and copy the output, and post it back here for viewing.
How do I find out what my txtUrl is called as confused.
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:48
Joined
Sep 21, 2011
Messages
14,319
How do I find out what my txtUrl is called as confused.
If you do not know the name of your control, or how to find it, you might want to fo back to basics and get a book on Basic Access.

The title is not meant to insult, but I was given the book Access 2007 for Dummies. You could look for one for your version.?
That will explain the basics of Access for your version.
That or look on YouTube for Steve Bishop videos on Access. You have to start somewhere, and not at the deep end.
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
If you do not know the name of your control, or how to find it, you might want to fo back to basics and get a book on Basic Access.

The title is not meant to insult, but I was given the book Access 2007 for Dummies. You could look for one for your version.?
That will explain the basics of Access for your version.
That or look on YouTube for Steve Bishop videos on Access. You have to start somewhere, and not at the deep end.
I know how to make tables, forms, queries, reports and add primary and foreign keys and make relationship but lately just been getting into some new complex stuff I am struggling with.
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
If you do not know the name of your control, or how to find it, you might want to fo back to basics and get a book on Basic Access.

The title is not meant to insult, but I was given the book Access 2007 for Dummies. You could look for one for your version.?
That will explain the basics of Access for your version.
That or look on YouTube for Steve Bishop videos on Access. You have to start somewhere, and not at the deep end.
Hang fire I have worked it out but does the control need to reference the object where the URL is or the name of the button control?
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:48
Joined
Sep 21, 2011
Messages
14,319
Hang fire I have worked it out but does the control need to reference the object where the URL is or the name of the button control?
If you are trying to refer to the url, have a guess?
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
1656851349491.png

Run time error when trying to run the URL.
 

cayham86

Member
Local time
Today, 09:48
Joined
Jun 30, 2022
Messages
54
Code:
Private Sub View_URL_Click()
Application.FollowHyperlink "http://" & Value_Source
End Sub
 

Users who are viewing this thread

Top Bottom