473,748 Members | 2,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2151

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

Similar topics

3
1693
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 parts computed in point()'s __init__ function with their values based on the arglist. I want to compute with point instances as though they were native complex numbers, but I want to be able to
9
1930
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 top.A.tableVar = document.getElementById("someTable"); As long as Frame B is *not* 'refreshed/ reloaded' witk another page the
5
3212
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
4128
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 cmplx, temp;
34
6463
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 operator. Here's what I'm trying to do. I've defined class Complex as class Complex { friend ostream &operator<<( ostream &, Complex & ); public: Complex( float = 0.0, float = 0.0 );
116
7537
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 and some who couldn't but that it wasn't important right now. And I said, 'sure, we can do that later'. So now I've developed an app without any thought to security and am trying to apply it afterwards. Doh!, doh! and triple doh!
7
1635
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, etc just like you do with real vectors. For instance, sth like the following should be possible: myVector x,y,z; //initialize vectors here... x = y+z;
17
3728
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 file <complex.h. I have Googled <complex.hand got about 177K hits, which I obviously do not wish to go through one at a time. I also tried "<complex.hsource" but still got Does anyone know where I can get a complete, definitive and
19
3636
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 seen sofar, is to just rewrite my code/query. Situation: I am sorting forms into the way they are used (print,storage,readonly,etc...).
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.