Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2003, 06:14 AM
Registered User
 
Join Date: Nov 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access: need a Query. please help me...

Hi the experts,

I import the Excel spreadsheet that appears in the first 5 fields in Access 2000 as PONumber, POItem, PartNumber, POQty and DeliveredQty.

Would you help me with the Update Query (or using VB code ?) so that when there are duplicate PartNumbers, I would like to sum up the PO Qty and the Delivered Qty for each single non-repeated Part Number.

I have been wasting a lot of time at work facing this problem and I greatly appreciate any help on this matter.
Many many thanks.


1) this is the data with duplicate PartNumbers:

PONumber POitem PartNumber POqty DeliveredQty
4500555746 10 3060-01204 10 8
4500558882 10 3060-01204 16 15
4500668771 20 3060-01204W 2 2
4500581882 10 3060-01204 8 4
4500564377 10 67225180000 1 0
4500664317 10 66824410001 1 0
4500578758 10 3700-02765 8 0
4500578758 20 3700-02765 2 1



2) this data below is the desired output table.

PONumber POitem PartNumber POqty DeliveredQty
4500555746 10 3060-01204 34 27
4500668771 20 3060-01204W 2 2
4500564377 10 67225180000 1 0
4500664317 10 66824410001 1 0
4500578758 10 3700-02765 10 1


 
Old December 14th, 2003, 01:02 PM
Authorized User
 
Join Date: Oct 2003
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi AlienScript,
I use "SELECT DISTINCT" queries, to filter out any duplicates in my records.
syntax;
SELECT DISTINCT (txtCity)
FROM tblCountries

You can use the "requery" function on the open method of the form to keep it up to date. (I haven't actually tried the requery in this case, but theoretically, it should keep it up to date whenever you open the form.
Good luck!
Any questions let me know!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Access query from a webpage? oldmainframehack Access VBA 1 August 13th, 2007 12:29 PM
MS Access Query rsm42 ASP.NET 1.0 and 1.1 Basics 2 March 20th, 2007 12:32 PM
Help with access query jrobertson Access VBA 6 January 25th, 2007 05:49 PM
Access Query gre_smi SQL Server 2000 2 January 11th, 2006 08:59 AM
need access query kale_tushar Access 2 January 3rd, 2005 05:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.