Results 1 to 8 of 8
  1. #1
    Travis101 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2019
    Posts
    4

    Referencing Other Records

    Hi,



    Struggling to think of a solution or find an answer to this one.

    What I need is quite specific. I will have several columns for different records. For specific reasons I need to have several records that have the same data in all columns except 2. However to eliminate user error in forgetting to repeat the data over the different records (Because there will be a lot of records), I need a way that we can update one record and all the data (Minus 2 columns) copies to the next say 5 or 6 records down.

    Is there a way I can do this in Access?

    Thanks
    Matt

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    One way, in the after update event of the relevant controls:

    http://www.theaccessweb.com/forms/frm0012.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Travis101 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2019
    Posts
    4
    Would this work for modifying existing records though if it is using the default value?
    I may be misinterpreting what the command is saying.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That would affect new records. Basically as you enter new records it would keep the same value in a field until you changed it. If you want to change existing records, you'd probably use an update query with a criteria that isolated the records you wanted updated.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Travis101 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2019
    Posts
    4
    What I essentially need is for access to check that a field is the same on other records (When editing data) and if it is, then it copies the edited data to those other records. Hopefully my explanation makes sense. It's a very odd situation.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    It sounds like you're working around a design problem. You can execute an update query that uses that field (more accurately that form control) in the criteria. Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Travis101 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2019
    Posts
    4
    Pretty much yes. It has to integrate with other software that reads the data and is more rigid in how it does so.

    I have only been experimenting with a random example database so far because the data for the actual application is confidential. I have added dropbox link to download the database that I have been experimenting with.

    So the example would be, we have a few barcode numbers that are the same over a few records (Primary Pack Code Column). The reference column needs to have different data in for each record.
    If someone edits the Description column for record 1 in this database, it needs to copy that same data into the field for the 3 records below it that have the same barcode number in primary pack code.

    Hopefully makes sense.

    https://www.dropbox.com/s/qbazfc7akitrgpk/Example%20Database.accdb?dl=0


  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Like I said, you can do it with an update query that uses the current value in that field in the criteria, and updates the desired fields. You'll need to fire it off from a form. Most of us never let users directly into tables, you have no control there and no events to work with. Trying to update data with a query that's also being updated via a form will often trigger a write conflict error, so you'll need to commit the form record before executing the query, then requery the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 12-28-2015, 04:11 PM
  2. Referencing Controls on and off a Tab
    By dccjr in forum Programming
    Replies: 2
    Last Post: 04-25-2013, 05:43 AM
  3. Referencing between Sub-reports.
    By michaelh93 in forum Reports
    Replies: 2
    Last Post: 01-15-2013, 06:28 PM
  4. Referencing multiple records in a table
    By akbigcat86 in forum Programming
    Replies: 14
    Last Post: 07-22-2010, 01:30 PM
  5. Replies: 0
    Last Post: 01-28-2009, 03:47 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