Full Version: Duplicating A Form
UtterAccess Forums > Microsoft® Access > Access Forms
MuskokaMad
I have a Form frm_NewOrderEntry2. I want to make a copy of this form frm_Layaway that uses the same layout and formulas with some modifications.
When I use the copy command I get a duplicate form but changing the code on any of the controls changes the original as well.
How do I accomplish this?
Thanks again!
Tony_Hine
It’s very common to find yourself in a position where you want to copy a form for performing a slightly different task to the original form. You may find yourself with a form which is ideal for viewing records, but not ideal for editing or adding records. The solution would seem to be to create a new form, an exact copy of the original and then make some modifications.
The problem is you can end up with the several forms with basically the same functionality in their underlying structure, but different controls for performing different functions. It becomes a bit tiresome managing this collection of “cloned forms” as when you make a fundamental change in one you have to go through and make the same fundamental change in them all.
The alternative is to stick with just one form, but then modify its appearance and functionality with VBA code which you trigger when the form is loaded, depending on what situation the form is loaded to perform.
A form is an “object” in its self; it can be manipulated with VBA code just like anything else within the MS Access environment.
I have a very old example here that may still be relevant:
Item seven here: demonstrates how to use one single form for several different scenarios.
MuskokaMad
My Problem is that I am actually trying to do 2 discrete tasks.
On case 1: I am creating a standard order so in a payments tab a validate that the total of the payments are equal to the value of the order before enabling a tab to enter delivery information. As well I mark the order as closed and mark the items for delivery where indicated.
In Case 2: I am collecting the same information but the validation is completely different. I have an extra calculated Control that indicates a minimum payment to layaway an item. I mark the order as pending and items aren't marked for delivery until payment is finalized.
So I had hoped that I could clone the form and make the changes to the 3 controls effected and move on. As I indicated it seems that any changes in the copy are implemented on the original as well.
Ideas
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.