Results 1 to 8 of 8
  1. #1
    Kelsey is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Location
    United States
    Posts
    14

    Append Query

    I am wanting to use an Append Query to append records from one database to another. I am having problem with deciding on criteria to append only the records that haven't already been appended to the second database table.

    Query:
    IssueQuantity
    InventoryID


    Cost
    PurchaseOrderDetailID
    Job ID

    Second table:
    ReceivingID
    InventoryID
    ReceivingQuantity
    Cost
    ReceivingDate
    PurchaseOrderDetailID

    I will be opening the append query sometime in the form frmIssueNew. I only need to Append the records that have a JobID of 22, and haven't already been appended.

    Any help on the criteria for this is appreciated! thanks!

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Just to be clear you said this:
    I am wanting to use an Append Query to append records from one database to another.
    Did you really mean to say that you are appending data from one table in the database to a table in a second database? Or, did you really mean to say that you are appending data from 1 table to another table within the SAME database?

    As to the query criteria, you will definitely need the jobID and then another field that distinguishes those records that have already been appended from those that can be appended.


    If you are doing this between 2 tables in the same database, then I am guessing that you have not properly structured your tables since you should not have two tables with such similar data. That is a guess at this point. Could you please provide a little more info on your table structure and what business process your database is intended to model?

  3. #3
    Kelsey is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Location
    United States
    Posts
    14
    Yes, I did mean to say 2 different databases. My current database is an inventory database, with the location being our parts room. We also have a Van that carries inventory in it. I was hoping to be able to append records issued to the Van FROM our parts room (carrying over cost and all), and then having a totally seperate inventory system for the 2nd database inventory. The inventory in the parts room is used for things different than that of what the Van inventory is used for.
    Hope this helps...

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    How are the two databases linked now? Are you using linked tables to link to the Van database? How do people in the van interact with the database as they use their inventory?

  5. #5
    Kelsey is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Location
    United States
    Posts
    14
    I'm just messing with it right now...but...
    I was using tblInventory as a linked table, and put the Van (ID 22) as a Job in the first database. The van gets all of its inventory from the parts room, so when the van needs to be re-stocked, you'd issue parts from the first database to the second. This would take the parts out of the parts room and put them into the 2nd via an append query. This would keep the issues in my tblIssueDetail table in the first database, and also put them in my tblVanReceiving in my second database. The parts get out of the van inventory by invoices to specific customers (different entirely) from the first database.

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Frankly, I would use only one database and track where the parts go based on location (Van, customer etc.). You can use a select query to get the inventory at any location at any time. Then you would not need to mess with append queries.

    tblPartTransactions
    -pkPartTransID primary key, autonumber
    -fkPartID foreign key to tblParts
    -quantity
    -fkLocationID foreign key to a table that holds all possible locations (parts room, van, customer etc.)
    -dteTrans (date of transaction)

    For more on inventory control, you might want to take a look at Allen Browne's site.

  7. #7
    Kelsey is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Location
    United States
    Posts
    14
    I have already looked at Allen Brownes site. The first database has been up and running properly with it's own module. I was hoping to implement Allen's design on the 2nd database. Thanks for your help.

  8. #8
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    OK, if you are going to use the 2 database approach then you will either need to add a flag field (yes/no field perhaps) to your current database to mark those items as being moved to the other database. Then after you run the append query, run an update query to mark the flag field accordingly. Alternatively, you could have a table that holds the date/time when the appends occur and then when it is time for the next event, just select those records whose date is > the last event date.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  2. append query
    By gimmy in forum Queries
    Replies: 1
    Last Post: 09-09-2011, 10:41 AM
  3. Append Query
    By waqas in forum Queries
    Replies: 5
    Last Post: 09-02-2011, 11:22 AM
  4. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  5. Append query won't append
    By yelkenli in forum Queries
    Replies: 5
    Last Post: 02-12-2010, 11:19 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