Copy Paste help

  • Thread starter Thread starter Derek
  • Start date Start date
D

Derek

I need to copy all of the fields data in a current form
and save that info, move to a simular form and paste
append it. Can I do this. Without using the clipboard. If
so how. I cannot see why it seems so difficult. If someone
wants to copy the entire contents of a form so that they
can create a new entry and then only change the few fields
required (my form has 70 fields, I know it's a lot but it
is nessassary)How do I do it? Arvin showed me how to copy
the existing form but what if I want to set up a form
which stores standard information to copy and then go back
to the main form and paste!
 
Derek said:
I need to copy all of the fields data in a current form
and save that info, move to a simular form and paste
append it. Can I do this. Without using the clipboard. If
so how. I cannot see why it seems so difficult. If someone
wants to copy the entire contents of a form so that they
can create a new entry and then only change the few fields
required (my form has 70 fields, I know it's a lot but it
is nessassary)How do I do it? Arvin showed me how to copy
the existing form but what if I want to set up a form
which stores standard information to copy and then go back
to the main form and paste!

I'd almost bet that 70 fields aren't necessary, but I won't argue the point.
If you build a table with 1 record and bind your form to it, or just use an
unbound form with each control source or DefaultValue set to a specific
value, like:

= 1
= "Derek"
= #1/6/04#

Then you can use the DefaultValue property of the new form to reference the
existing values in the first form in the new form's On Current event (air
code):

Sub Form_Current()
If Me.NewRecord = True Then
Me.txtBox1.DefaultValue = Forms!TheFirstForm.txtBox1
Me.txtBox2.DefaultValue = Forms!TheFirstForm.txtBox2
Me.txtBox3.DefaultValue = Forms!TheFirstForm.txtBox3
Me.txtBox4.DefaultValue = Forms!TheFirstForm.txtBox4
' etc.
End If
End Sub

If you use the table method for the first form, you can set the values and
they will be easy to change as you require those changes.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
You could create an append query with the query fields
coming from the open form. ex for your query field

Lname:[Forms]![formname]![Lname]
Fname:[Forms]![formname]![Fname]

Jim
 
Thanks Jim/Arvin

I selected the curent record (Lname:[Forms]![formname]!
[Lname])as you explained in an apend query. When run this
added the record to the end of the forms underlying table
and created a new ID number BRILLIANT!! Now without
apearing to be asking for the world The first form can
open (with command button) a related form giving further
product details. Sometimes the customer would like to copy
the existing record and make a few minor changes but would
also like to copy related record in another form and
consiquently another table. Whereas the previous system
worked for duplicating a forms underlining records and
can produce a new ID number when it is appended obviously
I cannot copy the asociated forms records because they are
linked to the first form or table by the ID number. so to
select them I need the original ID but I cannot paste
records to both tables because it would break referencial
integrety.
 
Back
Top