Results 1 to 7 of 7
  1. #1
    rose.zhu295@gmail.com is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Location
    australia
    Posts
    3

    Red face how to store queryA result into queryB?

    Hi I have queryA at the moment running some looping code and wanna store the result generated every time into queryB. Problem I have is that the queryA overides itself while looping and what I need is to store the result into queryB before queryA overides itself. And at the end I will have queryB storing all running results so that I can generate a report based on queryB result list.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    What do you mean by 'running some looping code' - is this actually VBA code manipulating a recordset object? Why would data be 'overwriting itself'? Only an UPDATE sql action or VBA code manipulating recordset can do that. Why would you change data in records if you need the original data for report?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rose.zhu295@gmail.com is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Location
    australia
    Posts
    3
    QueryA is running VBA which is filtering an original rawdata table with duplication in a field called [Description]. QueryA (index=i) firstly displays the same [Description] records (Description 1) with their entire rows including fields called [items] and [Price]. What I need is the sum of [items] and sum of [Price] for all the Description 1 into QueryB (which is only one row with Description 1, sumofitems, sumofprice). Then VBA lets QueryA (index = i+1) display all Description 2 records and their entire rows. The final report will display all QueryB records with only unique records in [Description] field (Description 1, 2,3...) and sumofitems and sumofprice. Sorry for my expression...

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Sorry, can't follow that. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Try telling readers what you are trying to do in plain English. Forget the query stuff and jargon until readers have some concept of WHAT you are trying to accomplish.
    You might even concoct an example:
    a)this the data I have
    b) this the output I need...

  6. #6
    pritesharyan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Location
    India
    Posts
    32
    Click image for larger version. 

Name:	access forum net.jpg 
Views:	8 
Size:	121.1 KB 
ID:	21972 do something like shows in this image. may help you . thanks.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Try telling readers what you are trying to do in plain English.

    This is the sort of thing that will help readers understand your "business opportunity/issue".(adjust and extend as appropriate)
    ---We are jewellery manufacturer... We are automating our inventory control system. We purchase semi finished items and raw materials from various suppliers. .....

    Tell us WHAT you do and what you are trying to automate --plain English.

    Here is a free, generic data model that may help.
    I recommend you start by working through this tutorial to understand database and table design, relationships and Normalization.
    Good luck with your project.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Best way to store a percent value?
    By Ruegen in forum Programming
    Replies: 1
    Last Post: 06-07-2015, 07:29 AM
  2. Replies: 9
    Last Post: 04-01-2014, 05:06 PM
  3. How To Store Attachments
    By David92595 in forum SQL Server
    Replies: 1
    Last Post: 10-11-2012, 02:01 PM
  4. Store backend on NAS?
    By justgeig in forum Access
    Replies: 1
    Last Post: 04-19-2012, 06:59 PM
  5. How would you store this?
    By techneophyte in forum Programming
    Replies: 1
    Last Post: 08-16-2010, 09:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums