?
Solved

Distinct Values in the RecordSet

Posted on 2004-10-21
8
Medium Priority
?
3,460 Views
Last Modified: 2013-11-26
hi experts,
  I have the recordset.  How do i get the distinct values in recordset.  Please note that I cannot modify the source.  Please let me know how this can be done.  I have to used find and filter property but could achive the desired result

Thanks
0
Comment
Question by:ajexpert
6 Comments
 
LVL 71

Expert Comment

by:Éric Moreau
ID: 12372123
You will need to sort the recordset and loop through each row to detect when the value change. There is nothing else you can do on an already opened recordset
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12372225
0
 
LVL 1

Expert Comment

by:bangerarun
ID: 12387320
Dear when you are creating the recordset i think you have to enter the query for distinct recordset

any you will get the records in disinct way

Banger
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 12442586
hi
i think bangerarun is right
u can change ur SQL Query like this
'-------------------------------------

SELECT DISTINCT *  FROM Your_Table_Name

'-------------------------------------
this will return only distinct rows from the table Your_Table_Name

;-)
Shiju

0
 
LVL 14

Author Comment

by:ajexpert
ID: 12492476
bangerarun, shijusn
 My query clearly says I cannot modify the source i.e. I cannot modify the query.  I have to play with recordset only to get distinct values
0
 
LVL 14

Accepted Solution

by:
Shiju Sasidharan earned 200 total points
ID: 12492883
hi ajexpert
ok , u need to findout distint values in a particular filed or need to findout distinct rows in the recordset ?
to extract distict values from a selected filed
it is better to add entry from the record set to a ListView and use the method
ListView1.FindItem to check whether u have already entered this entry  , if so skip and try with the next record in the field

This is not a direct method to solve ur problem . anyway it will work to filter record set

;-)
Shiju
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question