I have a user who wants a button to open a link in Firefox (His default internet browser) rather then IE.
The code for my button control is below, and is pretty handy. It creates a url for google maps for a location when given the address, state and zip code.
Private Sub MapItButton_Click()
'ie to google maps of project address
Dim strURL As String
Dim ie As New InternetExplorer
strURL = " & Me![ProjectAddress] & ",+" & Me![ProjectCity] & ",+" & [ProjectState] & "+" & [ProjectZipCode]
ie.Navigate strURL
Do Until ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
ie.Visible = True
Set ie = Nothing
End Sub
Also here is code to map from central location to a address given the address, state and zip code.
Private Sub DirectionsToButton_Click()
'ie to google maps - driving directions from XXXXX to project address
Dim strURL As String
Dim ie As New InternetExplorer
strURL = " Drive,+Lake+Buena+Vista,+Florida+32830&daddr=" & Me![ProjectAddress] & ",+" & Me![ProjectCity] & ",+" & [ProjectState] & "+" & [ProjectZipCode]
ie.Navigate strURL
Do Until ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
ie.Visible = True
Set ie = Nothing
End Sub
The code for my button control is below, and is pretty handy. It creates a url for google maps for a location when given the address, state and zip code.
Private Sub MapItButton_Click()
'ie to google maps of project address
Dim strURL As String
Dim ie As New InternetExplorer
strURL = " & Me![ProjectAddress] & ",+" & Me![ProjectCity] & ",+" & [ProjectState] & "+" & [ProjectZipCode]
ie.Navigate strURL
Do Until ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
ie.Visible = True
Set ie = Nothing
End Sub
Also here is code to map from central location to a address given the address, state and zip code.
Private Sub DirectionsToButton_Click()
'ie to google maps - driving directions from XXXXX to project address
Dim strURL As String
Dim ie As New InternetExplorer
strURL = " Drive,+Lake+Buena+Vista,+Florida+32830&daddr=" & Me![ProjectAddress] & ",+" & Me![ProjectCity] & ",+" & [ProjectState] & "+" & [ProjectZipCode]
ie.Navigate strURL
Do Until ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
ie.Visible = True
Set ie = Nothing
End Sub