Copy record

John M

Registered User.
Local time
Today, 19:18
Joined
Nov 20, 2001
Messages
69
Problem:
Form is used to input book information like author, title and etc. A lot of the times the information is the same except for the volume information. I want to be able to copy information from a book record and modify to create a new one. I've seen many similar postings but have not seen any solid replies. Please advise.
 
I pull information from one form to another (not one record to another record) with Forms![YourForm]![YourFormControl] = Forms![YourOriginalForm]![YourOriginalFormControl]. With the same form you end up with information not being current when you change records, but you could do it fairly simply with a few variables to store the information from the old entry in the meantime. Just keep in mind that the field may be blank and if its required in the form it may cause you a few snags.

HTH,
David R
 
Hi David R,
Sorry about posting in two different places!

I'm not sure how your solution works as I tried button your code in a button.

I want to be able to bring up a dialog box containing all the values of the underlying form. Then the user is allowed to make changes to it and then save a new copy. Please advise.
 
There's a lot of possible solutions to your problem, John. Here's a few ideas...

1) Probably the best idea is to take the information that duplicates itself into a separate lookup table. The Lookup Wizard make this fairly trivial to do.

2) From your question it sounds like you are storing a lot of information in two places. This violates database normalization rules and will cause a myriad of errors later on (typos, updates, and deletions all become royal RITA). You're much better off reworking the structure now than writing 17 workarounds for it later, even if it seems to take forever currently. I started off with a flat database with 60+ fields across it. I now have several smaller tables and accessing any of the data in it is not only straightforward, but possible in a fraction of the time.

Here's an excellent article on database normalization for beginners: http://www.devshed.com/Server_Side/MySQL/Normal/Normal1/page1.html

And if you do need to copy information from one record to another, try this Microsoft article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q210236

You can also use the slightly less code intensive Control-' to copy information from the LAST recorded entry in that field to this one. This will help if you're entering a series of books by one author all at once.

Take the time and a large sheet of paper and draw out what you need to have in your database. Separate it out into tables that only focus on ONE sort of data, and you only store one peice of data ONCE. (there are some rare exceptions to this, such as time-sensitive fluctuating prices on an invoice)

You won't regret it.

HTH,
David R
 
David R,

Thanks for your suggestions. No I don't have a problem with Database normalization. Lookup wizard would not help either. I just want to make it more convenient for the user to call up a old record make one or two changes and save as a new record. Sorry!! I'm afraid that I still don't really know that can be achieved. Anymore ideas.
 
Well, there is the decidedly low-tech answer of using the Duplicate Record command, if you have Record Selectors on. I believe it's under the edit menu, or on the standard toolbars if you have them enabled. If not you should be able to create a button that does the same thing.

Good luck!
David R
 
David R,

Thanks. I got the solution now. Its answered in the "General" section.

Thanks again
 

Users who are viewing this thread

Back
Top Bottom