copy returned rows, changing foreign key..

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top