Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: copy returned rows, changing foreign key..

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

copy returned rows, changing foreign key..
nycdon 10.09.2006 00:51:02
I have a form which returns budget items for a certain period. I'd like to be
able to call up a previous period's budget, then copy these rows changing the
period to give a template for a new budget period.
(keys are client_id and period)
any ideas appreciated!
thanks
Re: copy returned rows, changing foreign key..
pietlinden[ at ]hotmail.com 10.09.2006 04:08:34
use an inputbox or an unbound field on your form? Then just use
DBEngine(0)(0).Execute to execute the insert query to add the new
record...? There are several ways of doing this.

Re: copy returned rows, changing foreign key..
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 10.09.2006 05:03:39
If you don't have too many fields to copy, you can use an SQL insert to
new records into your table, with the source being itself. Assume the
new period number is to be 4, and you want to copy the records from
period 3:

Insert into BudgetTable (client_id,period,.....) select
(client_d,4,.....) from BudgetTable where period=3

The command inserts the constant 4 into period, instead of using the
existing table value.

John


nycdon wrote:

[Quoted Text]
> I have a form which returns budget items for a certain period. I'd like to be
> able to call up a previous period's budget, then copy these rows changing the
> period to give a template for a new budget period.
> (keys are client_id and period)
> any ideas appreciated!
> thanks

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net