Copy record in same table...

L

lupo666

Hi, I am trying to design a database to handle rent contracts. Since
these get renewed often, keeping most of the old data, the client has
asked me to "copy" a table row to a new one with a different ID. I use
a query to only display the contract currently shown on the form and
Copy/Paste does work, no problem...

Is there a way, thru a macro/module (button) to choose a record (row)
inside a table and copy it at the end of the SAME table with a
different ID, just like copy/paste does on my query?

Thank you in advance for any help you may provide, Lupo
 
A

Al Campagna

lupo666,
Create an Append query to add a new record to the table.
Use the ID of the record your form is on to define which record
you're appending from.
=Forms!frmYourOpenFormName!ID
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
L

lupo666

Thank you for your quick reply. It's the first thing I tried and it
gives me tons of errors, like duplicate keys and others. I can give
you more details next week, when I see my client again. Is it possible
to do it by module/macro?

Ciao, Lupo
 
L

lupo666

Thank you! I will try the commands next week and let you know. The
record should be OK as far as redundancy is concerned. It's layout is
more or less like this:

ID_CONTRACT

ID_OWNER
ID_PROPERTY --- These three refer to outside tables
ID_TENANT

INTERNAL ID
STARTING DATE
ENDING DATE
ANNUAL RENT
ANNUAL RENT IN WRITING

and so forth. They want to copy the record and change the last 5
fields (more like 20) in the given example.

This time, for the first time, I am starting to think I have
mishandled the problem. There will be 7 different contracts, all with
different clauses, all with dynamic values (fields) in them. After
completing the form with the required data, I export the shown record
to an XLS file and open a mailmerge DOC document which is the selected
contract, choosen by the user... Then, I have to open another
mailmerge DOC document to save it in XML format, because they want to
register the contract on-line with the Italian IRS equivalent...

I had to stir clear of reports because of the lack of advanced
formatting options that they need in the final documents...

I hope I can finish this project and get out of it ASAP, because it's
driving me nuts and it doesn't happen very often...

If you also have other ideas on how to make the program simpler or
more functional, please let me know, so I can start to go to sleep at
decent hours a night :-(((

Thank you, Lupo
 
L

lupo666

A little update: I designed the database/program from scratch the way
I would do it, without any external input. Getting a little paranoid,
I finally took a look at the two major rent managing programs for the
Italian rent market. They are, more or less, the same as mine. I feel
better, now. I just underestimated the time it would take me to finish
it, but I know now that I am on the right path and I can, eventually,
finish it...

Of course, with your help! :)))

Thank you so much for your help and support. I will keep you posted on
the developments...

Ciao, Lupo
 

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

Top