Solved

how to sort rows in grid using lookup field column?

Posted on 2001-06-11
7
348 Views
Last Modified: 2007-12-19
Hi,

Is there anyway to sort rows in grid using column that is based on lookup field?

The grid contains one lookup field that is pointing to the master file record ( i.e. EmployeeName ), I need to sort the rows based on the Employee's Name.  How?

Thanks
0
Comment
Question by:llkhor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 50 total points
ID: 6176242
Hello

  If you want to sort ur data in ur grid, you need to do that in the dataset (table or query), for table, make an index in the field that u want to sort on, then from table property
IndexFieldName = anyindexfield u make

or u can use the query and order by to sort any field u like, in the query component sql text:
'select * from customer oder by company' if you want to sort ur data using the company field

also you can download some dbgrid from torry that could sort ur data
http://www.torry.net/db_grids.htm

Best regards
Mohammed Nasman
0
 

Author Comment

by:llkhor
ID: 6176586
mnasman :  I know both the methods you described, i am just curious if u could do sorting with lookup field (kind=fkLookup) instead.  

Thanks.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6176991
only with a query by including the field, which is referenced like

select a.*, b.lookupresultfield from tableA a, tableB b where a.lookupidfield = b.idfield order by b.lookupresultfield

in some databases b.fields must not be included into the fieldlist after the select in some other databases is this a must

meikl ;-)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:llkhor
ID: 6179607
Thanks for the feedbacks....  
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8451579
Upon review of the comments here, I am recommending this disposition:

        points to mnasman

Please post a comment if you disagree.

DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8492512
per recommendation.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 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