Full Version: How to duplicate a record
UtterAccess Forums > Microsoft® Access > Access Forms
Humpty
Can anyone help me with a duplication issue?
I have a form that is used for reviewing processed orders so no data can be changed (all controls locked & disabled). I want to have a command button on the form that copies the record so the order entry form so a credit can be issued or the same order can be used (new order number) again.
I think I can figure it out with a simple form but this form has a subform which itself has a subform. Will I need to build up complicated queries on the fly to do this or am I missing something obvious?? shrug.gif
JVanKirk
Well, right off the bat, a duplicate record is redundant data and violates the normalization rules. You're question reads hard so I am not real sure how you're trying to use this record to issue credit. I would imagine a check box to flag the record as credited back would work but I am not familiar with your design.
Jason
Humpty
Thanks Jason, yes I realise that it was not worded too well.
When I say 'duplicate' I actually mean that I want to copy the details of the existing order into a new order (and then I can change the order number and price as needed) or issue it as a credit.
Hope this makes more sense.
Humpty
Perhaps a better way to explain this would be 'how do I copy a record'? I can easily do it for a main form but how do I extend that to the data in the nested subforms? confused.gif
ScottGem
I agree with Jason's first idea. Why do you need a copy of the record? Why not just add a flag to indicate its a credit?
Humpty
There could be a couple of possibilities here:
) An order has been entered and processed and once someone reviews it they realise that the order was issued to the wrong customer account (simple typing error). Rather than having to re-enter the whole order, if a user can simply 'copy' the existing and then change customer it would save considerable time.
2) Credits are not always issued in full by this business. Situations can occur where a customer needs a credit for 10% of the original order or the like. In these circumstances it is far easier to copy the original and alter the prices for the items rather than have to re-enter everything.
Does this make any more sense?
ScottGem
Nope. Why not alter the original order? Especially in the case of situation 1. If you need to you can create an audit trail or a revised flag to indicate the order was updated.
Y Why not alter the original order? Especially in the case of situation 1. If you need to you can create an audit trail or a revised flag to indicate the order was updated.
Your second scenario makes more sense, but the way I would do it, is by adding a transaction (assuming orders cover multiple items) that details the credit. That's one of the problems with your scenarios, if you have multiple line items, it makse duplication harder.
Maybe more details about your table structure would help.
JVanKirk
Scott, thanks for jumping in here, I've been running the halls setting up new monitors this AM. We just got in Samsung 19" 910T monitors, I'm staring into mine right now....she's so purdy!!
nyway, I would definately, having this new info, go with adding a field to flag it as a credit or add another table that holds order details and when you need to alter a customer that was ordered just setup a button on the form you use to view your orders which will unlock the customer control or open a form which allows you to edit the customer the order was placed for.
Jason
ScottGem
Only 19"??? I'm sitting in front of my 21" IBM P275. Mines bigger then yours laugh.gif
Humpty
Thanks for your input guys! It's great to be able to bounce such ideas around. I'll re-consider the situation and see if I can develop a better solution. o!
JVanKirk
cryhard.gif <--me, wishing mine was 21" now. OK, not really, I'm happy with the 19, it's pretty nice. Much bigger than this and it's really a waste of money. NOW 2 of these puppies sitting side by side so I could move my palettes around would be great.
ason
Humpty
Hey! Stop hijacking my thread! laugh.gif
JVanKirk
How is your project coming along? Did you figure out a way to do yor credits and edit your orders to allow the user to change the customer, etc.?
Humpty
On UK time here J so only just started working on it again. I'll let you know how I progress. Think I will probably flag orders for credit and add a button to the review form to allow the order to be ammended.
Humpty
In the end I implemented it exactly as you suggested: If an order needs to be edited then it is opened in a form that allows edits and is marked as ammended. If it needs to be credited in full then it is just flagged.
Thanks again for the help guys!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.