Solved

Autonumber undoes sort in Access 2003 table

Posted on 2007-04-04
3
212 Views
Last Modified: 2008-02-01
In Access 2003, I sort my table by product count such as 100 apple, 50 bananas, etc, I want to list my products by the most stock on hand first, I want to add a field that will count the rows. When I add an autonumber field and make it the primary key field, it undoes my product count field sort and makes the products with the least stock on hand first, rather than the way I had it. Is there some way to count the rows w/o undoing my sort?
0
Comment
Question by:contrain
[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
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 18852209
SELECT a.Fruit, (Select Count(b.Fruit) FROM myTable AS b WHERE b.Fruit=a.fruit ) AS Ctr
FROM myTable AS a;
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18852230

SELECT a.Fruit, (Select Count(b.Fruit) FROM myTable AS b WHERE b.Fruit=a.fruit ) AS Ctr
FROM myTable AS a
GROUP BY a.Fruit;
0
 

Author Comment

by:contrain
ID: 18852266
Thanks,
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

Suggested Solutions

Title # Comments Views Activity
Error 438 6 52
Copied Form giving Error 2448  (Can not assign values to this Object)  ? 6 52
access vba 5 56
CISCO WIFI 6 72
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

734 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