Solved

Duplicate problems

Posted on 2014-02-03
3
173 Views
Last Modified: 2014-02-08
If I am trying to duplicate a Sales order that uses 4 tables , Main (A) and 2 (B and C) tables linked to main.

I can generate a new accountID in A and append the original data to the first Related table to  B This will generate new ID numbers in Table B but there is another Related table C where the ID number has a one to one relationship on the ID numbers on B

How do I append new data to with the correct ID numbers in C table and generate the correct linking ID numbers when they don't exist until the A and B tables are appended
0
Comment
Question by:DatabaseDek
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39829487
You can do the inserts using DAO in a code loop and that will give you the ID you need as you insert each B record so you can use it to insert the C record.

One-to-one relationships are extremely rare in the real world especially when the "child" is required so I think you should probably reconsider your schema.
0
 

Author Comment

by:DatabaseDek
ID: 39843859
Hi Pat

The reason for two tables is that I am describing something very complex with the data in the form and I ran out of fields. (Yes all 250 of them)

Do you happen to know if this (250fields) is still a limit in later versions of access? I am still soldiering on with 2002 it's brilliantly simple and like many others I hate that ribbon!.
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 39844155
If you ran out of fields, you almost certainly have one or more repeating groups and should normalize the schema to make it easier to work with.

I have been designing data-centric applications using a variety of databases from VSAM and IMS to DB2 and Oracle and lately Jet/ACE and SQL Server for clients ranging from American Express, Readers' Digest and Boeing to the Government of Kuwait  and in over 40 years have never created a table with more than about a hundred columns.

Yes, the limit still exists with ACE (A2007, A2010, A2013).  There really is no reason to change it.  Databases like SQL Server, et al support more columns because they are used for data warehousing in addition to transactional processing applications.  With data warehouse applications, the data is flattened and denormalized and that is why you will occassionally see tables in a warehouse application with large column counts.

Regarding the interface change with A2007 - The ribbon is clunky but it is usable.  It is the nav pain (sic) that I still object to even after using it for over 7 years.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now