Copying multiple fields from one form to another

B

barrynichols

I have two forms, FormA and FormB, based on table A and B.

Both tables underlying the forms have different autonumbers as the
primary key.

Essentially, what I need to do is build a macro that :

Copies the contents Field1 and Field2 from the current record in Form
A,
Creates a new record in Form B, then
Pastes the contents of Field1 and Field2 from FormA into FormB

Any help gratefully appreciated
 
J

Jeff Boyce

You've described a "how". Now, "why"?

If you are intending to copy data from FormA (based on TableA) to FormB
(based on TableB), you are trying to copy data from TableA to TableB. Why?

In a well-normalized relational database design, it is rarely necessary to
have two tables holding the same data.

If you'll describe a bit more about what you trying to accomplish by having
two copies of the same data, the folks here in the newsgroups may be able to
offer alternate approaches.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
M

MuzicK622

You've described a "how". Now, "why"?

If you are intending to copy data from FormA (based on TableA) to FormB
(based on TableB), you are trying to copy data from TableA to TableB. Why?

In a well-normalized relational database design, it is rarely necessary to
have two tables holding the same data.

If you'll describe a bit more about what you trying to accomplish by having
two copies of the same data, the folks here in the newsgroups may be able to
offer alternate approaches.

--
Regards

Jeff Boycewww.InformationFutures.net

Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/










- Show quoted text -

Jeff, I am looking for the same answer! I have a form and table for
one group of people called "Evaluators" and another table and form
called "Sign Language Interpreters." I am using this for Event
Management purposes (meaning different departments handle different
sections of my database) and am needing to keep my data separate for
assignments, confirmation letters, badges, check requisitions, etc
that I have as written reports. However, I have a command button off
of the Evaluator form that says "Add as SL Interpreter." I would like
all of the name and address information as well as account numbers to
duplicate when I click my button. If I were the only one in the
database, I would simply use subforms, but at the request of other
areas, it needs to be separate. :(
 
M

MuzicK622

Jeff, I am looking for the same answer! I have a form and table for
one group of people called "Evaluators" and another table and form
called "Sign Language Interpreters." I am using this for Event
Management purposes (meaning different departments handle different
sections of my database) and am needing to keep my data separate for
assignments, confirmation letters, badges, check requisitions, etc
that I have as written reports. However, I have a command button off
of the Evaluator form that says "Add as SL Interpreter." I would like
all of the name and address information as well as account numbers to
duplicate when I click my button. If I were the only one in the
database, I would simply use subforms, but at the request of other
areas, it needs to be separate. :(- Hide quoted text -

- Show quoted text -

Woohoo! I found the answer for my form and possibly for you too!
On the form "evaluators", I have a button that says "Add as SL
Interpreter"
In the code for this command button I added the following line for
each field name I needed to duplicate:
Forms![Sign Language Interpreters]![LastName] = Me![LastName]

To get this to work you need to make sure that both forms are open.
Otherwise you will get an error. Best case scenario, you should never
have to duplicate information (and you really shouldn't!!), but this
can work for those of us who are really Admin. Assistants and not
programmers! :)
 
J

Jeff Boyce

While you have found a way to do this, have you also found a way to "ripple"
any changes you need to make?

For example, when you first put in someone's name, you misspelled it. Since
you've duplicated it, now you have to 1) find it everywhere you've
duplicated it to and 2) update it.

Another example ... people move. If you duplicate their address, ...

The approach you found is akin to what happens in Excel ... it notices that
you are using the same "name" and offers to duplicate it for you. And this
has the same problem as above ... no "ripples" unless you manually take care
of changes.

Good luck!

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Why?











Jeff, I am looking for the same answer! I have a form and table for
one group of people called "Evaluators" and another table and form
called "Sign Language Interpreters." I am using this for Event
Management purposes (meaning different departments handle different
sections of my database) and am needing to keep my data separate for
assignments, confirmation letters, badges, check requisitions, etc
that I have as written reports. However, I have a command button off
of the Evaluator form that says "Add as SL Interpreter." I would like
all of the name and address information as well as account numbers to
duplicate when I click my button. If I were the only one in the
database, I would simply use subforms, but at the request of other
areas, it needs to be separate. :(- Hide quoted text -

- Show quoted text -

Woohoo! I found the answer for my form and possibly for you too!
On the form "evaluators", I have a button that says "Add as SL
Interpreter"
In the code for this command button I added the following line for
each field name I needed to duplicate:
Forms![Sign Language Interpreters]![LastName] = Me![LastName]

To get this to work you need to make sure that both forms are open.
Otherwise you will get an error. Best case scenario, you should never
have to duplicate information (and you really shouldn't!!), but this
can work for those of us who are really Admin. Assistants and not
programmers! :)
 
M

MuzicK622

While you have found a way to do this, have you also found a way to "ripple"
any changes you need to make?

For example, when you first put in someone's name, you misspelled it. Since
you've duplicated it, now you have to 1) find it everywhere you've
duplicated it to and 2) update it.

Another example ... people move. If you duplicate their address, ...

The approach you found is akin to what happens in Excel ... it notices that
you are using the same "name" and offers to duplicate it for you. And this
has the same problem as above ... no "ripples" unless you manually take care
of changes.

Good luck!

--
Regards

Jeff Boycewww.InformationFutures.net

Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/




On Dec 19, 7:22 am, "Jeff Boyce" <[email protected]
DISCARD_HYPHEN_TO_END> wrote:
You've described a "how". Now, "why"?
If you are intending to copy data from FormA (based on TableA) to FormB
(based on TableB), you are trying to copy data from TableA to TableB.
Why?
In a well-normalized relational database design, it is rarely necessary to
have two tables holding the same data.
If you'll describe a bit more about what you trying to accomplish by having
two copies of the same data, the folks here in the newsgroups may be able to
offer alternate approaches.
--
Regards
Jeff Boycewww.InformationFutures.net
Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/
Woohoo! I found the answer for my form and possibly for you too!
On the form "evaluators", I have a button that says "Add as SL
Interpreter"
In the code for this command button I added the following line for
each field name I needed to duplicate:
Forms![Sign Language Interpreters]![LastName] = Me![LastName]
To get this to work you need to make sure that both forms are open.
Otherwise you will get an error. Best case scenario, you should never
have to duplicate information (and you really shouldn't!!), but this
can work for those of us who are really Admin. Assistants and not
programmers! :)- Hide quoted text -

- Show quoted text -

No, I haven't figured out how to fix that yet. Thank goodness that for
now we're dealing with so few names and those that I do have to
duplicate only matter for one year. We can manage manually fixing them
for now. If anyone does have a solution for this, I would like to know
about it. :)
 
J

Jeff Boyce

The solution is to not structure your data that way. Re-read my earlier
responses...

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

While you have found a way to do this, have you also found a way to "ripple"
any changes you need to make?

For example, when you first put in someone's name, you misspelled it. Since
you've duplicated it, now you have to 1) find it everywhere you've
duplicated it to and 2) update it.

Another example ... people move. If you duplicate their address, ...

The approach you found is akin to what happens in Excel ... it notices that
you are using the same "name" and offers to duplicate it for you. And this
has the same problem as above ... no "ripples" unless you manually take care
of changes.

Good luck!

--
Regards

Jeff Boycewww.InformationFutures.net

Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/




On Dec 19, 1:58 pm, (e-mail address removed) wrote:
On Dec 19, 7:22 am, "Jeff Boyce" <[email protected]
DISCARD_HYPHEN_TO_END> wrote:
You've described a "how". Now, "why"?
If you are intending to copy data from FormA (based on TableA) to FormB
(based on TableB), you are trying to copy data from TableA to
TableB.
Why?
In a well-normalized relational database design, it is rarely necessary to
have two tables holding the same data.
If you'll describe a bit more about what you trying to accomplish
by
having
two copies of the same data, the folks here in the newsgroups may
be
able to
offer alternate approaches.
Jeff Boycewww.InformationFutures.net
Microsoft Office/Access MVPhttp://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentorhttp://microsoftitacademy.com/
I have two forms, FormA and FormB, based on table A and B.
Both tables underlying the forms have different autonumbers as the
primary key.
Essentially, what I need to do is build a macro that :
Copies the contents Field1 and Field2 from the current record in Form
A,
Creates a new record in Form B, then
Pastes the contents of Field1 and Field2 from FormA into FormB
Any help gratefully appreciated- Hide quoted text -
- Show quoted text -
Jeff, I am looking for the same answer! I have a form and table for
one group of people called "Evaluators" and another table and form
called "Sign Language Interpreters." I am using this for Event
Management purposes (meaning different departments handle different
sections of my database) and am needing to keep my data separate for
assignments, confirmation letters, badges, check requisitions, etc
that I have as written reports. However, I have a command button off
of the Evaluator form that says "Add as SL Interpreter." I would like
all of the name and address information as well as account numbers to
duplicate when I click my button. If I were the only one in the
database, I would simply use subforms, but at the request of other
areas, it needs to be separate. :(- Hide quoted text -
- Show quoted text -
Woohoo! I found the answer for my form and possibly for you too!
On the form "evaluators", I have a button that says "Add as SL
Interpreter"
In the code for this command button I added the following line for
each field name I needed to duplicate:
Forms![Sign Language Interpreters]![LastName] = Me![LastName]
To get this to work you need to make sure that both forms are open.
Otherwise you will get an error. Best case scenario, you should never
have to duplicate information (and you really shouldn't!!), but this
can work for those of us who are really Admin. Assistants and not
programmers! :)- Hide quoted text -

- Show quoted text -

No, I haven't figured out how to fix that yet. Thank goodness that for
now we're dealing with so few names and those that I do have to
duplicate only matter for one year. We can manage manually fixing them
for now. If anyone does have a solution for this, I would like to know
about it. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top