473,322 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Complex Copy Function

I have a database with a Header table. Each record in tblHeader has
two One-to-Many Relationships: with tblLines and tblKeys. The HeaderID
field ties tblHeader to the other two tables. The data collected in
tblHeader is simple: HeaderID (unique), a text description field, and a
date field.

I need to be able to copy header and it's related info.

I have a form with a "Copy Source" combo box allowing the user to
select a Header record. Then two text fields allowing the user to
input a new description and date. Then a button saying "Copy Header".

What I need to do is assign VBA code to that button that does the
following:
1. Insert a new record into tblHeader, which will obviously receive a
new HeaderID, plus add the new Description and Date values (This part
is no problem).
2. Copy all records in tblLines and tblKeys that had a HeaderID
matching the "Copy Source" Header record. Paste duplicates in those
two tables, but when I paste, change the HeaderID value, so that all
the pasted records now tie to the new record in tblHeader.

The result is two Header records in tblHeader, with different
Description and Date fields, but having identical related records in
tblLines and tblKeys.

If the reason helps, we often have one Header record with hundreds of
Line and Key records tied to it. Sometimes we need to basically repeat
an exact entry, with a Key or Line change or two. What we want to do
is copy an existing record and all it's cascading related records under
a new Description, and then just edit the couple lines we need, instead
of having to recreate the whole thing.

Hope this makes sense. I have a few ideas on how to do this, but I was
hoping before I get halfway in and realize I should do it another way,
I'd get some expert advice on the best way to approach this. Thanks!

Feb 27 '06 #1
0 2118

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Olsen | last post by:
I want to define a class "point" as a subclass of complex. When I create an instance sample = point(<arglist>) I want "sample" to "be" a complex number, but with its real and imaginary...
9
by: F. Da Costa | last post by:
Hi, Does anybody know why IE5+ does *not* honour array objects (like a table) across a session? Example: Frame A contains a var tableVar which is set via form Frame B (on init) using...
5
by: Justin Caldicott | last post by:
Hi There are n solutions to the nth root of any number, eg: (-8)^(1/3) = 1 + sqrt(3)i or -2 or 1 - sqrt(3)i The following code:
21
by: Blair | last post by:
could someone PLEASE tell me why this doesn't work... ----------------------------------------- #include <complex> using namespace std; typedef complex<long double> cld; void main() { cld...
34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
7
by: silversurfer2025 | last post by:
Hello, I would like to overload the operators *, + and = in a class, which is used much like a vector (such as in linear algebra). For this, I need to be able to add featureVectors to each other,...
17
by: Julian V. Noble | last post by:
Dear C Mavens, I am writing a Computing Prescription for CiSE on complex arithmetic. I would like to be sure that I do not include any gaffes about C99--especially about what is in the header...
19
by: kawaks40 | last post by:
Hi everyone :) I just recently started using access/sql. and right away I ran into this problem "SQL expression too complex" I google'd a lot on what it means, and the only workaround I've...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.