Results 1 to 5 of 5
  1. #1
    sonoamore is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    18

    Passing Form Values - Deleting Duplicates

    Ok, I've tried quite a few different code snippets now trying to make this work and it's giving me a small aneurysm.

    2 Forms, 2 Tables

    Goal:



    - When button is clicked on FormA, open FormB with new record, setting the ID fields to the same value.
    - If FormA's ID already exists in FormB's table, delete that record and start a new record with the ID set as described above.
    - Copy values A,B,C from FormA to spots D,E,F in form B.

    Basically what's occurring here is this:

    FormA is the main data entry area. There is sometimes an additional form to generate (FormB) which includes some pieces of the data that already exist on FormA (nicknamed A,B,C in this case). However, if the user generates the form once and then later tries to do it again, I don't want to have multiple entries for FormB with the same ID. The ID is the distinguishing feature here as FormB's table setup is something like:

    FORMB_ID ID A B C

    This is so that each of the FormB records has a unique ID, and can be tied back to it's origin by use of the ID field.

    Honestly starting to go a bit crazy, any help anyone can give is GREATLY appreciated!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I am pretty sure you can not get an aneurysm by doing something. Instead, it is something you are born with.

    As for the A B C thing.... you have some issues with your tables. The design is what is causing your headache. This could cause problems if you do have an aneurysm.

    The whole, creating forms thing, is very confusing. Users should be creating records. The application should dictate what tables the user will or will not create a record in. The developer of the application creates the relations. The relations allow for peace and serenity. You need to normalize your structure.

  3. #3
    sonoamore is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    18
    Quote Originally Posted by ItsMe View Post
    I am pretty sure you can not get an aneurysm by doing something. Instead, it is something you are born with.

    As for the A B C thing.... you have some issues with your tables. The design is what is causing your headache. This could cause problems if you do have an aneurysm.

    The whole, creating forms thing, is very confusing. Users should be creating records. The application should dictate what tables the user will or will not create a record in. The developer of the application creates the relations. The relations allow for peace and serenity. You need to normalize your structure.
    Not sure why this response was even necessary.... but ok...

    1. "A, B, C" FormA, FormB, etc, are just place holders for the real names of the fields, and tables, etc, since I can't post the actuals here.

    2. No one's actually creating a form, it's an additional and seperate set of fields (or, a seperate form) that's not always necessary to fill out, but contains about 25% of the data that already exists. Hence why I want to copy it into that table. The application DOES dictate what tables they create records in, I just want to cut out some of the work by copying the data they've already entered.

    3. I can't have duplicate entries in the table for FormB, so I'm hoping there is a way to check for an existing ID match and delete the record if it was alrady there.

    Bonus: The term "have an aneurysm" is being used as a term to express frustration, much like "This thing is going to give me a heart attack!" If you were born with an aneurysm, you're probably dead.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Still confused. Not sure what to make of it. Sounds like you have multiple tables with duplicate data. Yet, you claim that you want to check for duplicate data.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Aneurysm: swelling of blood vessel wall that weakens the vessel, like an over-stretched balloon that eventually bursts. Stress doesn't help and you will have a lot of stress with the db design you describe. I agree with ItsMe, design and the behavior of forms is confusing. Why is same data in two tables? Perhaps if you gave a full description of what this db is for and the table structure, we could better advise. If you want to attach 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.

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

Similar Threads

  1. Passing multiple values to a second form
    By WithoutPause in forum Forms
    Replies: 39
    Last Post: 02-12-2014, 04:03 PM
  2. Replies: 4
    Last Post: 07-15-2013, 12:30 PM
  3. passing values from form to query
    By gregd in forum Access
    Replies: 6
    Last Post: 05-02-2013, 03:18 PM
  4. Replies: 1
    Last Post: 03-24-2010, 08:42 AM
  5. Deleting Duplicates
    By TundraMonkey in forum Queries
    Replies: 4
    Last Post: 09-08-2009, 07:13 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