Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Duplicate subfo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 30245 of 30658
Post > Topic >>

Duplicate subforms content and key link to another master table key

by SirTKC <andre.artsystems@[EMAIL PROTECTED] > May 12, 2008 at 08:06 PM

Hi,

Here is the following scenario.

I do have a master table with related subforms from wich I need to
create a revision.
But I need to duplicate the content of the subforms and link them to
the new entry in the master table.

Each string possess its unique identifier number.

So in this case I have a master table with the following structure
(simplified)

DesiID = Design Unique Identifier
Pnum = Project number
PPro = Prototype Number
PRev = Revision Number
FieldN = other fields

And subforms attached to the master table by the Unique identifier

PartID = Part Unique Identifier
DesiID = Link to master table
FieldN = Other Fields

Both strings are attached ONLY by the DesiID


I have the code (see code snippet) that allow me to create the
duplicate I need but it keeps attaching it to the original DesiID
instead of the new freshly created one by the revision generator.
I am scr(..) with this because all new entries remains attached to the
original DesiID instead of the new one... Thats my problem !

This is where I need a hand !

Thanks

CODE
============================================================================
With Me.RecordsetClone
            .AddNew
            '
                !PRev = Nz(DMax("PRev", "Design", "[PNum]=" & Me.PNum
& " And [PPro]= " & Me.PPro), 0) + 1
                !ProjID = Me.ProjID
                !PNum = Me.PNum
                !PPro = Me.PPro

            .Update

            Dim strSQL As String
  strSQL = "insert into Design_Struct (DesiID, FieldN) Select DesiID,
FieldN FROM Design_Struct WHERE Design_Struct.DesiID = " & Me.DesiID &
""
  CurrentDb.Execute strSQL

           Me.Bookmark = .LastModified
           Me.Requery: Me.Refresh

        End With
 




 2 Posts in Topic:
Duplicate subforms content and key link to another master table
SirTKC <andre.artsyste  2008-05-12 20:06:45 
Re: Duplicate subforms content and key link to another master ta
Bruce <deluxeinformati  2008-05-14 10:03:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 4:37:26 CDT 2008.