Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 14th, 2003, 06:14 AM
Registered User
 
Join Date: Nov 2003
Location: , , .
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


Reply With Quote
  #2 (permalink)  
Old December 14th, 2003, 01:02 PM
Authorized User
 
Join Date: Oct 2003
Location: Toronto, Ontario, Canada.
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!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:44 PM.


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