Duplicating subform data (1 Viewer)

munkeyroot

Registered User.
Local time
Today, 14:40
Joined
Jan 13, 2011
Messages
76
Hi Everyone
just wondered if anyone has come across this before.

i have a main form with sub forms and trying to duplicate them.

so method (in my madness) is to:

first use the duplicate macro on a command button for main form (as this gives me the first ID) - if tried this and works ok. this gives me the data from the main form - however not subforms.

Now the tricky part for the sub forms:
i was going to do this in the same way as the main form using the duplicate macro, however it would not know what the Main_ID is,
(in the tables i do have Subform_ID PK, Main_ID),
so i would need to tell the duplicate macro what ID to go to.
this is the bit i'm not sure on.

the macro would need to "select all records" on the table not just the one the cursor is in.

hope anyone can help or if i am on the right or wrong track

cheers munk
 

munkeyroot

Registered User.
Local time
Today, 14:40
Joined
Jan 13, 2011
Messages
76
ok so i figured out to select all records on the duplication.

the macro script is below.
so now i am stuck on for the script to say something on the lines of selected all, copied, paste in new record where main_ID is "manual Input"

sorry my VB is not great

OnError
Got to Next
Macro Name

RunMenuCommand
Command SelectAllRecords ------ Changed this from SelectRecord to SelectAllRecords

If [MacroError]=0 Then

RunMenuCommand
Command Copy
End If

If [MacroError]=0 Then

RunMenuCommand
Command RecordsGoToNew
End If


If [MacroError]=0 Then

RunMenuCommand
Command SelectRecords
End If
If [MacroError]=0 Then

RunMenuCommand
Command Copy
End If
If [MacroError]=0 Then

RunMenuCommand
Command Paste
End If

If [MacroError]<>0 Then

MessageBox
Message =[MacroError].[Description]
Beep Yes
Type None
Title
End If
 

Users who are viewing this thread

Top Bottom