Im building a button to open googlemaps with waypoints marked of all the points in my subform. On click however I keep getting
Run-time error '3061':
Too few parameters. Expected 1
code below
Private Sub Route_Plan_Click()
Dim strHyperlink As String
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("export_query")
strHyperlink = "https://www.google.com/maps/dir/?api=1&origin=','start point address>,+'<start postcode>'"
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
Do Until rs.EOF = True
strHyperlink = strHyperlink & "&waypoints=" & i & "='" & rs!Address & "',+'" & rs!Postcode & "'"
rs.MoveNext
Loop
End If
Application.FollowHyperlink (strHyperlink)
MsgBox "Finished looping through records."
rs.Close
Set rs = Nothing
End Sub
the form sets a query record source which I am looping through to create the string for the weblink but am at a loss on why I am getting this error if anyone has any advice or suggestions it would be greatly appreciated.
Set rs
, your query probably needs parameters you aren't providing, and you will need to either adjust your query or provide the required parameter. – Erik A