How can I parse or Loop a list based on single field to Googlemaps

This is some code that will parse each sequential field [Point_#) into a list 
for googlemaps. 

[Form_Runs].WebRouteMap.navigate 
"http://maps.google.co.uk/maps?f=q&hl=en&q=" & "from: " & Me.Point_1 & (" to: 
" + Me.Point_2) & (" to: " + Me.Point_3) 

The table/form is laid outlike this:

[Route_No]   [Point_1]        [Point_2]        [Point_2]
5                  North St, N1   East St, N3      High Road, W6

And the code will give this style of parsed list: 
from: North St, N1 to: East St, N3 to: High Road, W6


That works just fine for a finite number of separate fields, but I need to 
achieve the same thing for a single field, but with sequential records of 
data. The number of records (addresseses) will differ from main record to 
record, some routes are just a few addresesses, while others can be upto 12 
addresses, so I need the code to go through each record and sequentialy add 
the data to the parsed list ready for Googlemaps; bearing in mind that each 
list will be a different number of records. Does anyone know how I can do 
this with code?


The table/form is laid outlike this:

[Route_No]    [Run_waypoint]

5                   North St, N1
5	     East St, N3
5	     High Road, W6


0
Utf
4/24/2007 9:24:02 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
578 Views

Similar Articles

[PageSpeed] 9

You need to loop through your recordset, comparing the current RouteNo with 
the previous RouteNo.  Keep appending the Waypoints until the Route No 
changes.

Here is some approximate (untested) code:

Set rsRouteWaypoint = CurrentDB().OpenRecordset("RouteWaypoint")
With rsRouteWaypoint
  .MoveFirst
  strHoldRoute=![RouteNumber]
  strOut=![WayPoint] 

  Do While Not .EOF 
    strRoute=![RouteNumber]
    If strRoute<>strHoldRoute then
        debug.print strOut
        strHoldRoute = strRoute
        strOut= ![WayPoint] 
    Else
        strOut=strOut & " to: "  & ![WayPoint] 
    End If
    .MoveNext
  Loop
End With 'rsRouteWaypoint


"efandango" wrote:

> This is some code that will parse each sequential field [Point_#) into a list 
> for googlemaps. 
> 
> [Form_Runs].WebRouteMap.navigate 
> "http://maps.google.co.uk/maps?f=q&hl=en&q=" & "from: " & Me.Point_1 & (" to: 
> " + Me.Point_2) & (" to: " + Me.Point_3) 
> 
> The table/form is laid outlike this:
> 
> [Route_No]   [Point_1]        [Point_2]        [Point_2]
> 5                  North St, N1   East St, N3      High Road, W6
> 
> And the code will give this style of parsed list: 
> from: North St, N1 to: East St, N3 to: High Road, W6
> 
> 
> That works just fine for a finite number of separate fields, but I need to 
> achieve the same thing for a single field, but with sequential records of 
> data. The number of records (addresseses) will differ from main record to 
> record, some routes are just a few addresesses, while others can be upto 12 
> addresses, so I need the code to go through each record and sequentialy add 
> the data to the parsed list ready for Googlemaps; bearing in mind that each 
> list will be a different number of records. Does anyone know how I can do 
> this with code?
> 
> 
> The table/form is laid outlike this:
> 
> [Route_No]    [Run_waypoint]
> 
> 5                   North St, N1
> 5	     East St, N3
> 5	     High Road, W6
> 
> 
0
Utf
4/26/2007 12:56:02 AM
Hi Margaret,

I broadly follow your suggestion, but am a little confused and unsure of how 
or where the data outputs, does it go to a table or direct to the browser 
like my example ( "http://maps.google.co.uk/maps?f=q&hl=en&q=" & "from: " & 
Me.Point_1 & (" to: " + Me.Point_2) & (" to: " + Me.Point_3) does?. 

Also, are you using the syntax "RouteWaypoint" for my  [Run_waypoint]?
and is your [RouteNumber] the eqivelant of my [Run_No]?. 



"MargaretBartley" wrote:

> You need to loop through your recordset, comparing the current RouteNo with 
> the previous RouteNo.  Keep appending the Waypoints until the Route No 
> changes.
> 
> Here is some approximate (untested) code:
> 
> Set rsRouteWaypoint = CurrentDB().OpenRecordset("RouteWaypoint")
> With rsRouteWaypoint
>   .MoveFirst
>   strHoldRoute=![RouteNumber]
>   strOut=![WayPoint] 
> 
>   Do While Not .EOF 
>     strRoute=![RouteNumber]
>     If strRoute<>strHoldRoute then
>         debug.print strOut
>         strHoldRoute = strRoute
>         strOut= ![WayPoint] 
>     Else
>         strOut=strOut & " to: "  & ![WayPoint] 
>     End If
>     .MoveNext
>   Loop
> End With 'rsRouteWaypoint
> 
> 
> "efandango" wrote:
> 
> > This is some code that will parse each sequential field [Point_#) into a list 
> > for googlemaps. 
> > 
> > [Form_Runs].WebRouteMap.navigate 
> > "http://maps.google.co.uk/maps?f=q&hl=en&q=" & "from: " & Me.Point_1 & (" to: 
> > " + Me.Point_2) & (" to: " + Me.Point_3) 
> > 
> > The table/form is laid outlike this:
> > 
> > [Route_No]   [Point_1]        [Point_2]        [Point_2]
> > 5                  North St, N1   East St, N3      High Road, W6
> > 
> > And the code will give this style of parsed list: 
> > from: North St, N1 to: East St, N3 to: High Road, W6
> > 
> > 
> > That works just fine for a finite number of separate fields, but I need to 
> > achieve the same thing for a single field, but with sequential records of 
> > data. The number of records (addresseses) will differ from main record to 
> > record, some routes are just a few addresesses, while others can be upto 12 
> > addresses, so I need the code to go through each record and sequentialy add 
> > the data to the parsed list ready for Googlemaps; bearing in mind that each 
> > list will be a different number of records. Does anyone know how I can do 
> > this with code?
> > 
> > 
> > The table/form is laid outlike this:
> > 
> > [Route_No]    [Run_waypoint]
> > 
> > 5                   North St, N1
> > 5	     East St, N3
> > 5	     High Road, W6
> > 
> > 
0
Utf
4/26/2007 11:10:04 AM
Reply:

Similar Artilces:

Can't open shared access database with double click from explorer.
While trying to diagnose Access 2007 corrupting Access 2000 databases, I've come across a situation where if I try to double click an MDB file on a shared network drive, nothing happens. Access doesn't start (either with access 2000 or access 2007). However, if I wait til I get the "Open File - Security Warning" on one machine, then double click it on the other, then I can open it on both machines. In addition, I can always open it from the open menu in access. Obviously something to do with the open file warning is going on here. Is there any way to set the regist...

can i carryover data automatically from page to page and how?
I am trying to set up a month-to-month data sheet. Can I set it up so that the accumulated total from one month carries over to the next? -- JimVT "JimVT" <JimVT@discussions.microsoft.com> wrote in message news:CA742954-561A-4714-AE23-DA5DD031656B@microsoft.com... >I am trying to set up a month-to-month data sheet. Can I set it up so that > the accumulated total from one month carries over to the next? > -- > JimVT Of course - at the top of sheet 2 in the required column type in =Sheet1!(Cell the total is in on sheet 1). if you are uncertain as to how to ...

Can I use a Report expression for queries?
Is it possible to use the following expression that is used in reports on queries? =[Sales]/Sum([Sales])*100 Or some expression to get the result. Thank you. No. In your query, you can refer to text boxes on a form, but not on a report. That's because of the way reports are formatted (sequentially.) Forms have a current record, which identifies which value you want. Reports don't. In the context of a query, there are other ways to get totals, such as DLookup(): http://allenbrowne.com/casu-07.html or a subquery: http://allenbrowne.com/subquery-01.html -- Allen Browne ...

Can't Eliminate Client Edge
I have a window derived from CWnd. I added the following code: int CPane::OnCreate(LPCREATESTRUCT lpCreateStruct) { // Create our window lpCreateStruct->dwExStyle = lpCreateStruct->dwExStyle & ~WS_EX_CLIENTEDGE; if (CWnd::OnCreate(lpCreateStruct) == -1) return -1; // Etc. Yes, the window appears with a visible client edge. And if I use Spy++, it reports that the window has the WS_EX_CLIENTEDGE style. I even tried calling SetWindowLong but that has no effect. Does anyone have any ideas why my window insists on having a client edge? Thanks! -- Jonathan Wo...

If I accidently replace a saved file can I retrieve the old file?
No. PLEASE write your question in the body of the post and NOT just the subject. Have a look here: http://dts-l.org/goodpost.htm -- Gordon Burgess-Parker Interim Systems and Management Accounting www.gbpcomputing.co.uk "kamabiv" <kamabiv@discussions.microsoft.com> wrote in message news:2A547F5D-AA2C-44D7-AEC7-8961A81AC4E5@microsoft.com... > ...

modify the Type of Field in a Table From another MDB through a Command button
Hello to all! I hope can help me. By technical questions that would be to me very long to explain, the following necessity arises to me: I need To modify the Type of Field in a Table From another MDB through a Command button. The field at issue would happen to be "Number" to "TEXT". Is this possible one? I wait for alternatives. Thanks in advance, and sorry for my poor english. Dreamer. - Hi Is it not possible to open the other database and simply open the table in design view and then change the field. It seems very complex to do the codeing what will most pro...

consolidating and lists
I am tracking the time usage of my management team. I have created five worksheets for each day of the week, and then a sixth which contains a LIST of common tasks which is a dropdown column in the daily worksheets, to simplify their recording. Next to the dropdown LIST column they then indicate the number of 6 minute units spent on that task. I then want to consildate this data in a 7th summary worksheet so: Mon Tue Wed Thu Fri Total (LIST) TASK1 TASK2 TASK3 TASK4 TASK5 Any suggestions on this consolidation formula? Hi russ, you could try something like this (put thi...

Dynamic List Box using VBA
I wasn't really sure how to phrase this one -- this isn't your Typical Drop-Down List. I have a SELECT statement which queries SQL Server 2005 and displays the data in Excel. Let's say that a database lists products that have been delivered to 4 different cities, on 3 seperate days -- without knowing (in advance) the delivery dates, how could I create an input/drop-down field to allow the user to specify a particular date? I envision something like this: VBA code produces a list box of delivery dates based on a particular product and city. The user selects a delivery date ...

Filter by Field in Subform
I need to filter a main form based on fields in my subform. For example, my main form has a field [Order Number] and the header contains standard information about the origin of the parts and what is to be done with them, like the PO Number, and Customer information. My subform contains information like the Part Number, Qty, the ID Number for that particular line item, etc. My boss needs to be able to tell how many orders contain Part Number so and so... information that is specific to the underlying table in the subform, but he also needs the associated information in the main form...

how to arrange list by first or last name
I am trying to make a list with first, middle, last name , street address, and phone numbers. I like to know how you can review the list by any combination of first name, last name, city, state, and or phone number? hi can you give examples of how your list is layed out. i am thinking a helper column with an extraction formula might work. regards FSt1 "Andy" wrote: > I am trying to make a list with first, middle, last name , street address, > and phone numbers. I like to know how you can review the list by any > combination of first name, last name, c...

Using ExecuteQuery to get Listing of Cases
I'm attempting to programatically extract a listing of Cases (similar to the Cases listing in the Case Manager of the CRM app) using the Microsoft.Crm.Platform.Proxy.CRMQuery.ExecuteQuery() method. I can successfully extract Account and Contract info using ExecuteQuery, but I've been unsuccessful in locating a sample of a "QueryXML" string for listing Cases. This is my latest attempt, but I'm not even sure if "Incident" is the correct Entity for what I'm attempting. <fetch mapping='logical'> <entity name='Incident'> <order a...

Merging multiple addresses into single page containing 4 postcards
I'm using Publisher to create a post card mail merge document with pages set up as 4 - 5.5x4.25 cards in a 1/4 page letter format. When I enter the merge command Address Block in the Publisher "2 page spread" view and do a mail merge from my large excel address list, I get one full page of 4 post cards all going to the same address. How do I specify the merge commands so that each post card on a sheet of four receives a different address? Thank you for your help. -John Are you actually printing the cards or are you relying on the print preview? Print preview shows all ...

I have SQL Server installed on my workstation, can I not use MSDE
I have SQL Server Developer Edition on my workstation and I don't really want another instance of SQL on my box. Is there anyway for MS CRM 1.2 to use my existing installation? If you are referring to the MSDE datastore for the SFO client, then no, there isn't. It will install a new instance, but many of the underlying files are shared amongst the instances. Matt Parks ---------------------------------------- ---------------------------------------- On 23 Apr 2004 10:07:41 -0700, ramirez2sma@hotmail.com (Shawn Ramirez) wrote: I have SQL Server Developer Edition on my workstation ...

Custom lists from different sheets
Hi to all, I want to create a custom list from linked data from other sheets. Lets say we create the list on 'sheet10' and the values will be taken from: 'Sheet1!A1' , 'Sheet2!A1' , 'Sheet3!A1' ect....and i want the list to continue till 'Sheet9!A1'. I tried to drag the first three link cells (on sheet10),in order to create the list but the next cells didnt jump to: 'Sheet4!A1',Sheet5!A1'.... Does somebody knows the answer.... Thanks in advance Hi One way is to link your formula to the row number, and use this to increment your sheet numbe...

How can i use DAO Application
Hello freinds I have a software which is made in MFC and connected with MS Access 97 through DAO(Direct Access Object via MS jet Engine). Now i want to use same software for Postgresql and wanted to connected it through ODBC. Problem is that Old software has been developed for DAO,all main file like ,recordset,view doc r made for DAO. If i want to make it in ODBC,my classes like Set ,view Doc and other would be generated for ODBC. I dont know any option to use same software, Should i write whole software from the begining? I need ur help. thanks Sheikh ...

How do I protect one single cell?
I have a spreadsheet where people are going to type in numbers, and the final cell is a total, which of course I don't want people to accidentally type over, as it will lose the formula behind it. So...... I put some "data validation" behind that cell, to say only allow entries of text length = 50 - a kind of "mock" condition. Nobody'e ever gonna type in 50 chars. are they?! And sure enough, typing in (eg) 854221 brings up the error box to stop them, just like (eg) HHJSYT brings up the error box to stop them. I even unchecked the ignore blank" box, so that ent...

Can this be done
I use a 'closed' Citrix Metaframe delivered Outlook system at work and have no control over how it is configured. I can't even access my calandar/email from the internet - only when I'm in the office. What I want to do is somehow auto-forward my appointments from work to my home Outlook program/email address and populate my home calendar with my work meetings/schedule etc.... Can this be done ? Thanks in advance August The following article is all about synchronizing Outlook data between machines -- perhaps you'll find what you're looking for (there are 3rd part...

how can I see graphic in publisher doc as I work
When working on a publisher doc if I insert clip art it is not visible. It prints oK and shows in print preview, but not on the working doc. I have tried "view-pictures" every setting. I have updated drivers for graphic card but no joy. I use Office 2003 Professional XP home edition ...

how can I get a publisher file to acrobat reader
I have a Regestration Form created in publisher 2003. When a confrence addtendee signs on to our web site they need to be able to click on a file (acrobat reader) Hopfuly, and download it and print it so they can fill out the form and mail it off. (I say acobat reader because that seems to be the most common way it's done. I dont see an export in publisher or a inport to acrobat. how can i make this happen You will need a third party program to create the pdf file. Adobe Acrobat but it's spendy or a freebee i.e., Primopdf or another commercial program of modest cost, i.e., PDF-XC...

how can i make my page look like a page from a yearbook?
I have multiple photos that I need to get onto one page, all the same size and can't find a template for it! What version Publisher? If you are using 2003 or 07 the catalog merge maybe what you are needing. http://office.microsoft.com/en-us/publisher/CH062524751033.aspx If it is simply a one page, create a table, with your cursor in a cell, fill, fill effects, picture tab. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Brit" <Brit@discussions.microsoft.com> wrote in message news:A0D9C84F-F82E-474A-A18F-67A3B...

Query based on multiple parameters
I would like to create a query where the user can input 2 or more parameters (part numbers), separated by comma and/or space and return information about that part. I already have a query that accepts one parameter. Is there a way to do this with more than one? I have read some posts that say to use a table to serve up the paraments and the user chooses one or more. However, a particular part or parts may not yet be in the table as they are new or unknown. Is there any way to do this without using an existing table but just accept input from the user on the fly? T...

How can I make a calendar containing only six months per page?
I want to print a calendar with exactly 6 months per page. All of the template choices seem to be either 1 or 12. Any ideas? What version Publisher? Divide your page with grid guides. In 2007-- Insert, Design Gallery Object. Calendar, Select the date range. Adjust to fit the space. You will have to do this six times. If you have earlier versions there were wizards... -- Mary Sauer http://msauer.mvps.org/ "David M" <David M@discussions.microsoft.com> wrote in message news:7A8F66BD-4ED4-4439-8E9E-4A1E1833AC1A@microsoft.com... >I want to print a cale...

can i have a winxp product key please
Hi my computer all a sudden crashed and i reinstalled xp but lost product key and microsoft wont help mecan you please give me a product key No "jack wilkinson" wrote: > Hi my computer all a sudden crashed and i reinstalled xp but lost product > key and microsoft wont help mecan you please give me a product key > > > . > "jack wilkinson" <bargaindirect@clerk.com> wrote in message news:efTeyFszKHA.2436@TK2MSFTNGP04.phx.gbl... > Hi my computer all a sudden crashed and i reinstalled xp but lost product > key and...

Can the Item Description wrap to multiple lines on an invoice?
We have some long item descriptions (up to the 100 character limit), and we were trying to figure out how to get them to print on an invoice. If I spread the field all out on a single line, it's too long to fit on the document. If I create a box that's several lines tall, it does partially wrap, but it doesn't print the full description - it cuts off after around the 60th character or so. Has anyone successfully wrapped an item description on an invoice? -- Bud Cool, Accounting System Manager HDA, Inc. Hazelwood, MO GP 9.0, SP2 I think you'll need to parse it and then...

Viewing missing Contact list
I stupidly tried to combine PST files without backing each up (don't do this!) Now I can't find my main Contacts folder. I see an older, smaller Contacts folder that cam in from the smaller imported PST. I think it is still in the merged PST (500 MB)because it is larger than it was previous to merging. Any ideas on how to view the important Contacts folder would be very appreciated! stevec <slcolucci@yahoo.com> wrote: > I stupidly tried to combine PST files without backing each up (don't > do this!) Now I can't find my main Contacts folder. I see an older, >...