CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 button to COPY RECORD?

Print topic Send  topic

Author Message
Dr.Bob
Posted: 08/01/2002, 12:00 AM

Yes, I know a good database should not have the same data in multiple
records (not a good database design, right? :-) but I have a situation now
that I prefer to do this: having almost identical records (with only things
like date and time different).

So I'd like to know: Is there a way to copy a record, except for the unique
ID-field? (PHPMyAdmin and PHPMyEdit also have this, for instance) Also maybe
from within the record-page, that I have a button for INSERT but also INSERT
AND COPY TO NEW FORM or something like that?

Thanx in advance,
Dr.Bob

Roger McIlmoyle
Posted: 08/01/2002, 8:08 PM

Sure, take a look at the generated code of a standard record form. You will
see that all of the fields are actually passed as parameters. Therefore you
can tweak the form by using the after update event and issue response.write
command where you send all of the values to the form without the key
parameters. This will cause the form to be in "Insert" mode. Then use the
default value parameter for each field to pick of the passed values.

You can add the button by either tweaking the custom show event or tinkering
with the form footer to creat a button.


"Dr.Bob" <dr.bob.sayNoToSpam@extent.nl> wrote in message
news:aiam9m$luh$1@news.codecharge.com...
> Yes, I know a good database should not have the same data in multiple
> records (not a good database design, right? :-) but I have a situation now
> that I prefer to do this: having almost identical records (with only
things
> like date and time different).
>
> So I'd like to know: Is there a way to copy a record, except for the
unique
> ID-field? (PHPMyAdmin and PHPMyEdit also have this, for instance) Also
maybe
> from within the record-page, that I have a button for INSERT but also
INSERT
> AND COPY TO NEW FORM or something like that?
>
> Thanx in advance,
> Dr.Bob
>
>

Dr.Bob
Posted: 08/02/2002, 1:45 AM

Thanx Roger,
I will try this soon. Since I have no experience yet with the events in CC,
have you, or anybody else here, done this kind of record copying before and
give me some example code? That would be great ...

T.I.A.
Dr.Bob

"Roger McIlmoyle" <rmcilmyl@idirect.com> wrote in message
news:aict47$n0k$1@news.codecharge.com...
> Sure, take a look at the generated code of a standard record form. You
will
> see that all of the fields are actually passed as parameters. Therefore
you
> can tweak the form by using the after update event and issue
response.write
> command where you send all of the values to the form without the key
> parameters. This will cause the form to be in "Insert" mode. Then use the
> default value parameter for each field to pick of the passed values.
>
> You can add the button by either tweaking the custom show event or
tinkering
> with the form footer to creat a button.
>
>
> "Dr.Bob" <dr.bob.sayNoToSpam@extent.nl> wrote in message
>news:aiam9m$luh$1@news.codecharge.com...
> > Yes, I know a good database should not have the same data in multiple
> > records (not a good database design, right? :-) but I have a situation
now
> > that I prefer to do this: having almost identical records (with only
> things
> > like date and time different).
> >
> > So I'd like to know: Is there a way to copy a record, except for the
> unique
> > ID-field? (PHPMyAdmin and PHPMyEdit also have this, for instance) Also
> maybe
> > from within the record-page, that I have a button for INSERT but also
> INSERT
> > AND COPY TO NEW FORM or something like that?
> >
> > Thanx in advance,
> > Dr.Bob
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.