Copy a form

C

chooriang

Hi,
If we copy and paste a form,Does it will create new query as the control
source.If we input the data into the copied form,where is the data will be
storage.
 
R

Rob Parker

The copy of the form will have the same recordsource as the original; data
entered into it will be stored in the table which the query refers to.

If you want data entered into the copied form to be stored in a different
table, you must change the recordsource for the copied form, to either the
different table itself, or an updateable query based on the table.

HTH,

Rob
 
D

Douglas J. Steele

Not quite.

If you've specified that the recordsource of the form is a string (as
opposed to the name of a table or query), Access actually creates a hidden
query for you named ~sql_fxxxx, where xxxx is the name of the form. If you
copy that form, Access will create a new hidden query for you, named
~sql_fyyyy, where yyyy is the name of the new form.

Yes, the SQL associated with each will initially be identical, so as you say
data entered into either form will be stored in the same query. However, if
you change the SQL for the old form, it will not affect the new form (or
vice versa).
 
R

Rob Parker

Hi Doug,

That's getting quite deep; I'm not sure the OP will appreciate this level of
detail. But in either case, the copied form will have the same recordsource
as the original, until it is changed (in either the original form or the
copy).

Rob
 
D

Douglas J. Steele

Excuse me for being pedantic, but I wanted to make it clear that it isn't
the same recordsource, but merely a copy of the original recordsource, for
that specific case.

Yes, it's somewhat subtle. However, I think it's important to realize that
if FormA is based on an existing query (Query1), the user makes a copy of
FormA (FormB) and then changes Query1, the changes to Query1 will be
reflected on both forms. However, if FormA is based on a SQL String, the
user makes a copy of FormA (FormB) and then changes the SQL String for
FormA, FormB will not be impacted.
 
R

Rob Parker

Hi Doug,

No excuse needed.

And (from someone who's often accused of being pedantic) thanks for adding
the additional information. I use these groups as a knowledgebase, and I'm
thankful for as much information as possible in a thread. Sadly, I think
that many posters don't even consider doing a search before asking a
question. You, and the other MVPs, seem to have the patience of saints!
Thanks to you all for being there!

Rob
 
Top