PC Review


Reply
Thread Tools Rate Thread

advanced Recordset sorting

 
 
Marc
Guest
Posts: n/a
 
      15th Dec 2006
Hi the below code looks through a query and creates a point on a map
for each record.

However rather than just going through each record, I need to do a kind
of secondary sort on the query. For example...there may be 100 records
in the query, but 5 different groups of records (with 20 records in
each group. So rathe than look through all 100 records I need to look
through the first 20...then chnage the colour of the point and look
through the next 20 on so on.

The data looks like...

route 1 - citywatford
route 1 - city maidenhead
route2 - city birminihgam
route 2 - city london
route 3 ...etc. etc.

and it is the route number i want to group by.

The route numbers change each time the program is run also

Anyone who can help?????? Thanks in advance

Marc
------------------------------------------------------------------------

Set Recordset = CurrentDb.OpenRecordset("SELECT * FROM QueryRoutes;")
If Recordset.RecordCount > 0 Then
While Not Recordset.EOF
i = i + 1
ReDim Preserve objLoc2(1 To i)
Set objLoc2(i) = objMap.FindAddressResults(Recordset!Address,
Recordset!City, , , Recordset!Postal_code, geoCountryUnitedKingdom)(1)
Set objPin = objMap.AddPushpin(objLoc2(i), Recordset!Address)
Recordset.MoveNext
Wend
End If

 
Reply With Quote
 
 
 
 
strive4peace
Guest
Posts: n/a
 
      16th Dec 2006
Hi Marc,

make a temporary field in your table structure (for the route or
whatever you will sort by). Just before you create the map points,
updte the table with temporary field information so you can use it to sort.

Warm Regards,
Crystal
*
(: have an awesome day
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Marc wrote:
> Hi the below code looks through a query and creates a point on a map
> for each record.
>
> However rather than just going through each record, I need to do a kind
> of secondary sort on the query. For example...there may be 100 records
> in the query, but 5 different groups of records (with 20 records in
> each group. So rathe than look through all 100 records I need to look
> through the first 20...then chnage the colour of the point and look
> through the next 20 on so on.
>
> The data looks like...
>
> route 1 - citywatford
> route 1 - city maidenhead
> route2 - city birminihgam
> route 2 - city london
> route 3 ...etc. etc.
>
> and it is the route number i want to group by.
>
> The route numbers change each time the program is run also
>
> Anyone who can help?????? Thanks in advance
>
> Marc
> ------------------------------------------------------------------------
>
> Set Recordset = CurrentDb.OpenRecordset("SELECT * FROM QueryRoutes;")
> If Recordset.RecordCount > 0 Then
> While Not Recordset.EOF
> i = i + 1
> ReDim Preserve objLoc2(1 To i)
> Set objLoc2(i) = objMap.FindAddressResults(Recordset!Address,
> Recordset!City, , , Recordset!Postal_code, geoCountryUnitedKingdom)(1)
> Set objPin = objMap.AddPushpin(objLoc2(i), Recordset!Address)
> Recordset.MoveNext
> Wend
> End If
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced sorting Gerben Dirksen Microsoft Excel Worksheet Functions 4 26th Jul 2008 07:16 PM
Advanced Sorting =?Utf-8?B?RGlzcGF0Y2hlciBTY290dA==?= Microsoft Access Queries 5 5th Sep 2007 09:32 PM
Advanced Sorting #'s?? =?Utf-8?B?TWlzc3k=?= Microsoft Excel Misc 3 12th Apr 2006 11:37 PM
Re: !Recordset from a parameterized query, as the form's recordset. Problem on sorting... Savvoulidis Iordanis Microsoft Access Forms 0 24th Jun 2004 08:52 AM
Advanced Sorting =?Utf-8?B?TGFjcmVlZGE=?= Microsoft Excel Worksheet Functions 0 8th Mar 2004 03:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:44 AM.