Duplicate records from different forms!

ksgirl

Registered User.
Local time
Today, 23:51
Joined
Jul 1, 2002
Messages
53
I've been reading other posts that are similar to my problem, but I'm still left with a few questions to get me started. This is the post where you can find my source of information so far.....

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=17031

I have three forms. One form and the other two are basically "sub" forms, but are just linked to a primary key value from each form:
Primary Key- Clearance ID
Clearance ID Search Form (main form)
Clearance Work Order Form (linked form)
Clearance Tag Form (linked form)

With me so far? I know I have to have three different append queries (one for each table) and I have those set up accordingly. (Well I hope I have them set up right....I just don't know how to use them yet.) In the post that I've referrenced to above, it mentions that the queries will need two parameters an OldSite and a NewSite. This is where I'm confused.... Do I set these up as fields in the queries? And how do I set up their 'criteria' and 'append to' ? I basically want a button on the main form ("Copy Clearance" button) that will copy that record and all of the records that are associated with the work orders and tags to a new Clearance ID. Then I want the main form to pop up with this new record, and have buttons on that form where you can click and see the work orders form or click and see the tags form. My next question: Will I need three different forms for these records to display in? Could someone point me in the right direction. I think I've found what I'm needing on another post.... I just don't know where to start! Any help, would be greatly appreciated!!
;)
 
this sample shows the proper use of the old/new values:

Insert Into YourTable (fld1, fld2, fld3)
Select [NewSite], t.fld2, t.fld3
From YourTable as t
Where fld1 = [OldSite];
 
I am still extremely confused!! I knew Pat would be to my rescue! I guess I'm not sure where to put these "new site" and "old side" parameters.... In the query? Why do you suggest putting them on the form? Are you talking about the Primary Key's (Clearance ID) new and old value? HELP!!!!
Here is how the forms and fields are set up:

Clearance ID Search Form (Main Form)
*Equipment ID
*Clearance Description
Clearance Work Order Form (Linked Form)
*Work Order ID
*Work Order Description
Clearance Tag Form (Linked Form)
*TagNo
*Equipment ID --->different equip. ID's will be for each different tag... they are not the same ID as the one in the main form
*Position
*Tag Status
*Reason for Modification

I want the user to bring up the original Clearance (that is in the database) and be able to copy that info plus the info associated with the work orders and tags that were with the original. Hopefully this will be with a button, where the user can "click" to copy the Clearance. The work orders and tags might have anywhere from 1 to 20 different records, so having to input all of that by hand is very tedious, that is why it would be easier to use the button method....hopefully. After these records are duplicated, I need the user to be able to make changes to the forms incase they need to add/remove some of the info.

Secondly, with the link mentioned above and the reply from Pat, where do you put this code:

Insert Into YourTable (fld1, fld2, fld3)
Select [NewSite], t.fld2, t.fld3
From YourTable as t
Where fld1 = [OldSite];

In the On-Click event? I'm lost! I don't even know where to pick this code apart at. Anyone want to help a mentally-chanllenged-ksgirl?
 

Users who are viewing this thread

Back
Top Bottom