Can we have a hyperlink in a form?

Creating and using forms
Post Reply
banjoman
Posts: 9
Joined: Wed Jul 30, 2008 12:08 am

Can we have a hyperlink in a form?

Post by banjoman »

can you make an entry in a form a hyperlink so that by clicking it in the form view you can visit the url of the link? if so, how?
 Edit: Hagar: changed title. 
OOo 2.3.X on Mandriva + windows xp
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: hyperlink

Post by Villeroy »

No, unfortunately hyperlink fields are desperately missing. I tried to write a most simple workaround aimed to handle all sorts of URLs with a little bit of adjustment: [Solved] How to Open a PDF from a form
If your URLs in the database are typical ones including the protocol (such as "http:") then you are done with copying the code into the suggested directory, add a button named "URL_Button" to your form, add the URL-field name as "Additional Information" to the button and assign the form's record-change event to macro "url_on_record_change".
The button will open the hyperlink contained in the specified field then.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
QuazzieEvil
Volunteer
Posts: 283
Joined: Tue Dec 04, 2007 6:38 pm
Location: Houston, TX

Re: hyperlink

Post by QuazzieEvil »

Also, If your URL is in a text box, you can do something like this

Code: Select all

Sub BrowseURL(Event As Object)
	REM CODE BOUND TO CLICK EVENT OF TEXT BOX
	Dim Browser As String
	
	Browser="C:\Program Files\Mozilla Firefox\firefox.exe"
	Shell(Browser & " " & Event.Source.Text)
End Sub
User avatar
Hagar Delest
Moderator
Posts: 33366
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Can we have a hyperlink in a form?

Post by Hagar Delest »

LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
banjoman
Posts: 9
Joined: Wed Jul 30, 2008 12:08 am

Re: Can we have a hyperlink in a form?

Post by banjoman »

I think I get the hang of these answers, basically it is assigning a macro to a button which will read the data (a URL) and run it in Firefox - yes?

my reason for using OpenBase is so I get cross platform usability as I need to switch between Windows (which I still depend on for certain software tools) and Linux (which I am still getting into)

if I set up a macro when using Windows XP will it work when using that database file under Linux?
OOo 2.3.X on Mandriva + windows xp
QuazzieEvil
Volunteer
Posts: 283
Joined: Tue Dec 04, 2007 6:38 pm
Location: Houston, TX

Re: Can we have a hyperlink in a form?

Post by QuazzieEvil »

Yes, the only exceptions is system specific items such as paths/urls. These are of coarse diffent in windows and linux. use the built-in function GuiType to determine operating system. If function returns 1 for windows and 4 for linux. not sure about value for mac/other
Post Reply