Hi Vlad, i have used this before but would probably need a lot of adjustment, this is on a different database, this should open a new browser and add the destinations based on the input of postcodes (qty) you still have to type the postcodes in via an input though
Code:
Dim mPC As String, mPC2 As String, mPC3 As String, mPC4 As String, mPC5 As String, mPC6 As StringDim mPC7 As String, mPC8 As String, mPC9 As String, mPC10 As String, stAppName As String
Dim mPCQTy As Long
Dim mPC11 As String, mPC12 As String, mPC13 As String, mPC14 As String, mPC15 As String, mPC16 As String, mPC17 As String, mPC18 As String, mPC19 As String, mPC20 As String
Dim mStr As String, mFin As String, mPlan As String, rsBody As String, MySQL As String, TotalPCs As String, Col As String, ColRed As String
Dim mDate As Date
Dim myPostCodes As String, MyURL As String
Dim iQty As Integer, MyInput As Integer
Dim rs As DAO.Recordset
Col = "Collection"
ColRed = "Collection Ready"
mPlan = "Planning"
mDate = Format(Forms!frmMainMenu!frmIndex1!cboShipmentDateIndex1, "mm/dd/yyyy")
MyInput = InputBox("Do You Want To View Map With:" & vbNewLine & vbNewLine & _
"1" & vbTab & "What Is Left Planning" & vbNewLine & vbNewLine & _
"2" & vbTab & "The Full Week", "ENTER MAP OPTION")
Select Case MyInput
Case 1
iQty = DCount("PostCode", "qryPostCodes")
Case 2
iQty = DCount("PostCode", "qryPostCodesAll")
End Select
If MyInput = "1" Then
Set rs = CurrentDb.OpenRecordset("Select tblEdit.PostCode From tblEdit WHERE ShipmentDate = #" & mDate & "# And Status = '" & mPlan & "' Group By PostCode;")
Do Until rs.EOF
rs.MoveFirst
myPostCodes = rs.Fields("PostCode")
MyURL = "https://www.google.co.uk/maps/dir/" & myPostCodes
Loop
OpenFile = Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & MyURL, vbMaximizedFocus)
End If
If MyInput = "2" Then
Set rs = CurrentDb.OpenRecordset("Select tblEdit.PostCode From tblEdit WHERE ShipmentDate = #" & mDate & "# And Status <> '" & Col & "' Or Status <> '" & ColRed & "' Group By PostCode;")
rs.MoveFirst
myPostCodes = rs.Fields("PostCode")
If MsgBox(rs.RecordCount & " " & "PostCodes", vbOKCancel, "POSTCODES COUNTED") = vbCancel Then
DoCmd.CancelEvent
Else
Do Until rs.EOF
MyURL = "https://www.google.co.uk/maps/dir/" & myPostCodes
Loop
OpenFile = Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & MyURL, vbMaximizedFocus)
End If
End If