Can I create a command button that opens IE and pass an associated website address to target? In other words, I list a text link in a form. If I add a button what is the event procedure I need to create to pass along the actual url to IE?
The 'No Frills' and 'Simplest' approach by far is:
__1 Assuming a Text Box on your Form named txtURL.
__2 Typing a Internet Address into this Text Box. e.g. yahoo.com, microsoft.com, etc.and placing this code in the Click() Event of a Command Button will navigate to that location assuming it is a valid Address.
__3 You must know the Absolute Path to Internet Explorer for this to work.
__4 An invalid address will simply produce the This Page cannot be displayed screen within IE.
__5 You may also want to look into the possibility of incorporating a Microsoft Web Browser Control into your application.
- If Len(Me![txtURL]) > 0 Then
-
Dim retVal
-
retVal = Shell("C:\Program Files\Internet Explorer\Iexplore.exe " & Me![txtURL], vbMaximizedFocus)
-
Else
-
Exit Sub
-
End If