essexfire
Posts: 2
|
Posted: 06/28/2012, 2:03 AM |
|
Hi
I have a record form and i would like to be able to add another entry into the database when an existing record is dispkayed in the form (basically a copy of the exisitng record but allowing the form users to change values before the form is submitted).
Can anyone suggest the best way to achieve this?
Can the form mode be changed when in edit mode?
Thanks
Regards
|
|
|
ab5ni
Posts: 177
|
Posted: 06/28/2012, 10:21 AM |
|
Hmm.. What I would do is add a "Copy" button to the form, and when you click on it, it adds a new record with the edited values and exits.
_________________
Randall Jouett
Amateur Radio: AB5NI
I eat spaghetti code out of a bit-bucket while sitting at a hash table! And yes, I paid for the meal in cache!
|
|
|
MichaelMcDonald
Posts: 640
|
Posted: 06/28/2012, 12:07 PM |
|
Place a second record form on the page.
Set it to allow insert only.
Make it hidden by default.
On your second record form place fields that you want from the original record and any you want to populate with your own input. One of these make a hidden field called "copyof".
In your database table add a field to the existing named "copyof". This will allow you to find any copies of the original.
On your grid link in "Href Source" specify the record ID and any fields from the record that you want to copy as DB Parameters, and at least the speceify the record ID as "copyof".
In the record form before show event place custom code that makes the form visible when the record ID getvalue is not null (!= NULL), you can also specify > 0 - this has the same result.
Add to your search form a field called "copy of".
_________________
Central Coast, NSW, Australia.
|
|
|
|