| View previous topic :: View next topic |
| Author |
Message |
oxigen74 Newbie

Joined: 02 Feb 2004 Posts: 1
|
Posted: Mon Feb 02, 2004 5:32 am Post subject: How Can I create a hyperlink on subform ? |
|
|
Dear All,
I link a form with a subform. All is Ok. Now I have one colum where the data are hyperlink (http:\\..etc..). How can I find the way to select the hyperlnk and go directly to web page?
Best Regrds
Oxigen74 |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Mon Feb 02, 2004 6:11 pm Post subject: |
|
|
One method>>>
1. Put a button control on the subform, set type to url.
2. Create a macro that gets the url from the control that is displaying it and puts it in the targeturl property of the pushbutton
3. Assign the macro to the 'mouse inside' event of the pushbutton
Example of the macro code where the form has a listbox with the urls to be selected. Note that the urls must be valid like "http://www.ibm.com/us/" not just www.etc
| Code: | Sub Main
odoc=thiscomponent
oForm=odoc.drawpage.forms.getbyname("Standard")
oCtl=oForm.getbyname("PushButton") 'pushbutton control is of type URL
osourcectl=oForm.getbyname("ListBox") 'listbox contains list of urls
' set the targeturl property of url pushbutton to the first selected item in the listbox
oCtl.TargetURL = osourcectl.stringitemlist(osourcectl.selecteditems(0) )
End Sub |
|
|
| Back to top |
|
 |
|