Hi there...
I have done something similar to this using macros. I'm sure there are ways to do this with only a script... but. This is what i have to offer, and it is really much more simple than its steps make it seem.
---------------------------------------------
I'm making a couple of assumptions below...
1. User selects an IP address from a combobox named "COMBONAME"
2. User clicks on a separate object to pull up printers website.
3. The hyperlink can be created live, (hyperlink is not stored).
4. Form name is "FORMNAME" , label is named "link"
5. Macro name is "MACRONAME"
---------------------------------------------
In the form with your combobox, create an unbound label near the combobox the user will select the IP address in. Have it's caption say "Go to printer" or something... we're naming this label link in its properties. Also in its properties, set "is hyperlink" to yes but leave "hyperlinkaddress" blank. Save the form.
----------------------------------------------
Create a new macro and title it MACRONAME
Have the first action set to "SetValue"
In the properties for SetValue input the following into the Item information
[Forms]![FORMNAME]![link].[HyperlinkAddress]
([HyperlinkAddress] isn't something you need to change the name of... its the aspect of the label "link".
In the properties for SetValue input the following into the Expression information
"http://" & [COMBONAME]
Save macro.
----------------------------------------------
Now, in your form insert the following code in the form properties in the appropriate place. Here I'm assuming I want Form_Current, I'll leave it up to you to find the right place.
- Private Sub Form_Current()
-
On Error GoTo Err_Form_Current
-
-
Dim stDocName As String
-
-
stDocName = "MACRONAME"
-
DoCmd.RunMacro stDocName
-
-
Exit_Form_Current:
-
Exit Sub
-
-
Err_Form_Current:
-
MsgBox Err.Description
-
Resume Exit_Form_Current
-
End Sub
---------------------------------------------------
---------------------------------------------------
I hope this was clear, I've been a bit distracted while writing. Let me if you have questions or can't figure out what I mean... Or also if you get it to work :) For me, this allowed my user to select an IP address from my combobox, and immediately click on a label next to the combo box, and it brings up the ip address with http:// in front, in their default browser.
theAybaras.