[AccessD] Copying Records

William Hindman wdhindman at dejpolsystems.com
Sat Nov 28 13:17:17 CST 2009


...so you have to import the header record ID as an FK in the new header 
record, and then use it to sync the imported detail records to the imported 
header record PK ...a TransferDatabase still works but you have to set up 
the Import Spec to get the original header ID into the FK field, then 
another TransferDatabase to get the detail records, and then an update query 
to link them ...not exactly elegant but it should work and easy to automate 
in code.

William

--------------------------------------------------
From: "Rocky Smolin" <rockysmolin at bchacc.com>
Sent: Saturday, November 28, 2009 1:46 PM
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Copying Records

> For a straight record copy that works.  But in this case I'm importing
> header and detail records, so the imported detail records have to use the 
> PK
> of the new header records in the target table as the FK.
>
> Rocky
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Hindman
> Sent: Saturday, November 28, 2009 10:22 AM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Copying Records
>
> ...by virtue of habit I prefer using the DoCmd.TransferDatabase method 
> with
> a query.
>
> William
>
> --------------------------------------------------
> From: "Rocky Smolin" <rockysmolin at bchacc.com>
> Sent: Saturday, November 28, 2009 12:10 PM
> To: "'Access Developers discussion and problem solving'"
> <accessd at databaseadvisors.com>
> Subject: [AccessD] Copying Records
>
>> Dear list:
>>
>> I have to copy a number of records from a table in an external
>> database to the current back end.  The source and object tables have the
> same fields.
>> Normally I would do this by setting up a look to copy field by field,
>> record by record, and that works.  But it seems like there should be a
>> more elegant technique.
>>
>> I suppose I could create links to the source tables and make an append
>> query to the target tables.
>>
>> Any other ideas?
>>
>> MTIA
>>
>>
>>
>> rocky
>>
>>
>>
>>
>
>
>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list