Results 1 to 10 of 10
  1. #1
    sai541 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    4

    Append Data - Dependent on the presence of a unique serial.

    Hi everyone,



    I have three tables and need a way to pull data from two (tbl1 tbl2) into the third(tbl3). The table being appended into contains a unique serial and no two serials will be the same, however within each record are incomplete fields. If the serial is present in tbl 1 or tbl2, i need it to pull other similar fields such as Date, Name and Ref No. into corresponding fields for that record in tb3.

    I've been playing around with an append query but without success. What I'm hoping for here is a link or a guide to a similar process.

    Thanks in advance for any suggestions.

    Regards

    Jeremy

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If I understand, you need to:

    1. update fields in tbl3 with data from tbl1 and/or tbl2

    2. add new records to tbl3 from tbl1 and/or tbl2 if not already in tbl3

    No. 1 requires an UPDATE sql action. No2. would be an INSERT sql action.

    Why do you need to do this? Are you trying to modify a database structure? If not, this appears to be duplication of data.
    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
    sai541 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    4
    Numero uno. Tb3 will always have the unique identifier before tbl 1 and 2 see it. It is a duplication however, we need this particular setup because of our funding arrangements.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Can't just do a SELECT query that joins tables and use that query for your requirements, which are what - report output?

    Would be helpful to know more about table structure. Post sample data or even provide db. 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
    sai541 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    4
    I couldnt get it to 2mb so I've got some screen shots that might be able to help.

    Tb1
    Click image for larger version. 

Name:	tb1.jpg 
Views:	11 
Size:	103.5 KB 
ID:	15095

    Tbl2

    Click image for larger version. 

Name:	tb2.jpg 
Views:	11 
Size:	92.4 KB 
ID:	15096

    Tbl3

    Click image for larger version. 

Name:	tb3.jpg 
Views:	11 
Size:	98.7 KB 
ID:	15097

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Sorry, no, too hard to work with the images. I don't want to try and recreate tables based on the images.

    That looks like a small database. Why cannot get to 2MB zip? Did you run Compact & Repair? Make copy and delete some records.

    Didn't address my question.
    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.

  7. #7
    sai541 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    4
    I completely appreciate that. I have taken all of the data and all irrelevant forms/tables and even with zipping it comes in at 3mb. In terms of table structure this is what I have.

    Reference No is the identifier for the particular instance where a client has accessed relief services, client name and ID isnt used as a particular client may access our services multiple times within a year. Tbl Target $100 will have prepopulated data, such as the voucher type and number when we recieve them (as well as other fields I havent included which we have for accounting purposes). If I was using excel I would have a vlookup function that would populate the missing data (reference no, client name, client ID) from a voucher no found in Tbl Vouchers. We currently issue 10 types of vouchers, so in addition to Tbl Target there are other types. I'm aware its possible to run append queries to show which ref no, client name and client ID correspond to each voucher no in Tbl Target, but I havent yet had any success in this. I'm also aware that this is a duplication of data (which is a swear word in access land).

    Any advice would be greatly appreciated.
    TblData Tbl Vouchers Tbl Target $100
    Reference No (PK) PK (PK) Reference No
    Client Name Date Voucher Type
    Dob Voucher Type Voucher No
    Client ID Voucher No Client Name
    Ect. Client Name Client ID
    Reference No

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You ran Compact & Repair?

    Alternative is upload to a fileshare site such as Box.com and post link to the file.


    Don't save Client name in tblVouchers, just the Client ID. Don't save Client name nor Client ID in tblTarget. The VoucherNo is a link to the client info through tblVouchers.

    Not append queries, just a SELECT query that joins tables.


    Are you saying you have separate tables for various types of vouchers? These tables all have the same fields? Should be one table with a field for voucher type.


    Should avoid spaces or special characters/punctuation (underscore is exception) in naming convention. Better would be tblTarget100Dol, VoucherNo, Voucher_No.
    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.

  9. #9
    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,726
    Can you post a copy of your Relationships window?

    What makes this data base so large?? Compact repair should remove unnecessary material.

    Another option is to create new database (empty), then copy your tables, queries etc to new database.

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I agree, from what I can see of the database structure in the images, it should not be that large a file, especially without data. Although a few records would be helpful.
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 10-23-2013, 08:06 AM
  2. Check for the presence of a picture.
    By sergran in forum Programming
    Replies: 4
    Last Post: 08-08-2013, 09:22 AM
  3. Replies: 2
    Last Post: 05-21-2012, 08:46 PM
  4. append xml data and rename unique id
    By DanChirila in forum Import/Export Data
    Replies: 1
    Last Post: 04-01-2012, 11:39 AM
  5. Serial No for data rows?
    By cap.zadi in forum Reports
    Replies: 3
    Last Post: 12-06-2011, 10:47 AM

Tags for this Thread

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