Duplicating Form and Subform records

imsuneaik

New member
Local time
Tomorrow, 04:02
Joined
Sep 5, 2019
Messages
8
Hi everyone,

I am trying to duplicate my main form and sub form records. By using queries, i was able to make the duplicate the record for the main form as they are from the same table (eg. No. 150 and No. 151)


I have 2 tables named List and Item, linked by ID as their relationship.

- Record from the Main Form (List)
- SubForm (List) that displays records of Items (from table) tagged by their ID.

When I open the subform of the newly duplicated record with has an auto increment (eg. 151), I wasnt able to find the records of items, since they are still tagged under their previous ID (eg.150) in the Items table.

May I check if there's a workabout to this problem? Thanks
 
you use query also to duplicate the subform table:

insert into subTable (LinkingField, otherfield, otherfield) select 150, T.otherfield, T.otherfield from subTable As T where T1.LinkingField = 150;
 
Not sure if this is the answer you are looking for, but I thought it might give you some ideas.

I answered a similar question recently. The OP wanted to be able to create a set of similar records in the subform.

See this blog:- Subform Record Duplicator:-

https://www.niftyaccess.com/subform-record-duplicator/

Sent from my Pixel 3a using Tapatalk
 
You need to insert the copy of the main form using DAO (or ADO) so you can obtain the generated autonumber. Then you need an append query for each child table that takes two arguments. The ID of the parent record to identify the child records they want to select and the second argument is the ID of the new parent record where they want to append the child records.
 

Users who are viewing this thread

Back
Top Bottom