473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Copying between subforms, help please.

Hi all, I would appreciate some help please.
I just need pointing in the right direction as I am at a loss.
Basically I have a form (frmAddMaster) which displays two subforms
"Master Stock subform" and "Client Stock Template subform".
Each subform contains the following fields "Product ID,Product Description
and Size".
What I am trying to do is to select rows from the "Master Stock subform" and
copy them
to "Client Stock Template subform". I have created a macro which works but
only for
the "Product ID" field, it will not copy the rest of the row.
However if I manually select a row in "Master Stock subform" using the
cursor and then right click and
select copy, then move to the "Master Stock subform", select "Paste Append"
from the "Edit"
menu it works fine, what I want to be able to do is to select the rows from
"Master Stock subform"
then click a command button to automate the cut and paste process, is this
possible?

Regards, Dave.
--
--
radioman

Please remove "spamnot" to reply.

http://homepage.ntlworld.com/daves.den


Nov 12 '05 #1
3 3383
R-man:

A clarification: you don't really move data from subform to subform;
you move data from table to table. The subforms only display the
data.

Assuming that your subforms are based on different tables (implied in
your description below), copying a record from one table to another
can be done via a query. You just need to
- create the query that copies the data
- run the query at the appropriate time
- requery the 2nd subform to show the new record

You could maybe use "parameter query" (see help if you don't know
about these).

Give us more detail about your macro. It sound as if you're almost
there.

-Matt

On Sat, 10 Apr 2004 15:13:41 +0100, "radioman"
<sp**************@ntlworld.com> wrote:
Hi all, I would appreciate some help please.
I just need pointing in the right direction as I am at a loss.
Basically I have a form (frmAddMaster) which displays two subforms
"Master Stock subform" and "Client Stock Template subform".
Each subform contains the following fields "Product ID,Product Description
and Size".
What I am trying to do is to select rows from the "Master Stock subform" and
copy them
to "Client Stock Template subform". I have created a macro which works but
only for
the "Product ID" field, it will not copy the rest of the row.
However if I manually select a row in "Master Stock subform" using the
cursor and then right click and
select copy, then move to the "Master Stock subform", select "Paste Append"
from the "Edit"
menu it works fine, what I want to be able to do is to select the rows from
"Master Stock subform"
then click a command button to automate the cut and paste process, is this
possible?

Regards, Dave.
--


Nov 12 '05 #2
Hi Matt, thanks for the reply.
Yes I understand that the subform is only displaying what is
in tables and yes, there are two different tables.
Perhaps a little background will make things clearer.

My cousin runs his own business as a Stocktaker to the
Licensed Trade and is using an old DOS based program which
is no longer supported. I rather foolishly suggested I could write
a replacement using Access for him to use, although I have had some
experience with Access I am still very much a beginner, consequently my
request for help.

Basically the macro is trying to replicate the manual cut and paste
operation.
Macro Name: CopyItems
Action: GoToControl Master Stock subform Select subform.
Action: RunCommand Copy Copy selected data.
Action: GoToControl Client Stock Template subform Select Client
stock subform.
Action: RunCommand PasteAppend Append to Client Stock Table.

As I say this works but only for the first field "Product ID".
--
--
radioman

Please remove "spamnot" to reply.

http://homepage.ntlworld.com/daves.den

"Matthew Sullivan" <Ma**@NoSpam.com> wrote in message
news:dr********************************@4ax.com...
R-man:

A clarification: you don't really move data from subform to subform;
you move data from table to table. The subforms only display the
data.

Assuming that your subforms are based on different tables (implied in
your description below), copying a record from one table to another
can be done via a query. You just need to
- create the query that copies the data
- run the query at the appropriate time
- requery the 2nd subform to show the new record

You could maybe use "parameter query" (see help if you don't know
about these).

Give us more detail about your macro. It sound as if you're almost
there.

-Matt

On Sat, 10 Apr 2004 15:13:41 +0100, "radioman"
<sp**************@ntlworld.com> wrote:
Hi all, I would appreciate some help please.
I just need pointing in the right direction as I am at a loss.
Basically I have a form (frmAddMaster) which displays two subforms
"Master Stock subform" and "Client Stock Template subform".
Each subform contains the following fields "Product ID,Product Descriptionand Size".
What I am trying to do is to select rows from the "Master Stock subform" andcopy them
to "Client Stock Template subform". I have created a macro which works butonly for
the "Product ID" field, it will not copy the rest of the row.
However if I manually select a row in "Master Stock subform" using the
cursor and then right click and
select copy, then move to the "Master Stock subform", select "Paste Append"from the "Edit"
menu it works fine, what I want to be able to do is to select the rows from"Master Stock subform"
then click a command button to automate the cut and paste process, is thispossible?

Regards, Dave.
--

Nov 12 '05 #3
R-Man:

If I were doing it for myself, I'd use a Parameter Query.

A Parameter Query would basically be a query that appends a record
from the Master table into the Client table. You would give it a
criterion for the Product ID. That criterion would be a reference to
the Product ID of the selected record in on the Master subform, and
would have a syntax like this:

[Forms]![frm_TheParentForm]![chd_SubformControl]![txt_TheSubformControl]

See the Help for more info about Parameter Queries.

-Matt

On Mon, 12 Apr 2004 08:22:15 +0100, "radioman"
<sp**************@ntlworld.com> wrote:
Hi Matt, thanks for the reply.
Yes I understand that the subform is only displaying what is
in tables and yes, there are two different tables.
Perhaps a little background will make things clearer.

My cousin runs his own business as a Stocktaker to the
Licensed Trade and is using an old DOS based program which
is no longer supported. I rather foolishly suggested I could write
a replacement using Access for him to use, although I have had some
experience with Access I am still very much a beginner, consequently my
request for help.

Basically the macro is trying to replicate the manual cut and paste
operation.
Macro Name: CopyItems
Action: GoToControl Master Stock subform Select subform.
Action: RunCommand Copy Copy selected data.
Action: GoToControl Client Stock Template subform Select Client
stock subform.
Action: RunCommand PasteAppend Append to Client Stock Table.

As I say this works but only for the first field "Product ID".
--


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JJMM | last post by:
Hi, I have a form (form1) with a large number of subforms inside it (around 20 subforms), There is the possibility of filtering the data using a pop-up form that create/change a query (all the...
3
by: radioman | last post by:
Hi all, I would appreciate some help please. I just need pointing in the right direction as I am at a loss. Basically I have a form (frmAddMaster) which displays two subforms "Master Stock...
2
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms...
0
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't...
3
by: Diana Gard | last post by:
Perhaps this is a design flaw, please let me know. I'm using Access 2000. I have a form with a tab control and 5 subforms within those tabs. The forms match with the tables: Client main,...
12
by: Paul T. RONG | last post by:
Is it possible to divide a tall subform with 80 records to two subforms each with 40 records? Dear All, What I have: Tables: tblProduct, tblOrder, tblOrderDetail
0
by: misscrf | last post by:
I have an entry form which has a tab control. If print screens are needed, please let me know and I will prepare them and post them. Anyway, this tab control has 3 pages. When I am on one of the...
0
by: estelling | last post by:
Hello, I hope someone can help me with this, cause I'm trying a lot of things, but without success.... For information: I 've created a database in Microsoft Access 2000, for telephony...
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.