472,371 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to copy a recordset!?!?!

Tlm
Hello All,

I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also
has a subform embedded in it (SubFrmC) The form's recordsource is based on a
table (TblA). SubFrmB's recordsource is also based on a table (TblB).
SubFrmC's recordsource is also based on a table (TblC).

There is a one-to-many relationship between TblA (one) and TblB (many).
There is a also a one-to-many relationship between TblB (one) and
TblC(many). The forms are similarly linked.

I want to be able to copy the recordset in SubFrmB - along with its many
records in SubFrmC - so I can then insert that recordset as a new record in
FrmA.

I considered using the RecordsetClone function for this. But since the
RecordsetClone property setting makes a copy of the underlying table
specified by the form's RecordSource property, that won't work for me since
there are three tables in play here.

Any and all suggestions on how I could possibly accomplish this would be
GREATLY appreciated!

Thanks!!!

Tom
Nov 12 '05 #1
3 8232
"Tlm" <t.*******@comcast.net> wrote in
news:hvdsb.174780$Fm2.153056@attbi_s04:
Hello All,

I have a form (FrmA) with a subform (SubFrmB) embedded in it.
SubFrmB also has a subform embedded in it (SubFrmC) The form's
recordsource is based on a table (TblA). SubFrmB's
recordsource is also based on a table (TblB). SubFrmC's
recordsource is also based on a table (TblC).

There is a one-to-many relationship between TblA (one) and
TblB (many). There is a also a one-to-many relationship
between TblB (one) and TblC(many). The forms are similarly
linked.

I want to be able to copy the recordset in SubFrmB - along
with its many records in SubFrmC - so I can then insert that
recordset as a new record in FrmA.
What you want to do is only possible if the three tables have
identical structures. You are seesntially talking that you want to
copy a row from table B into Table A and the row(s) from Table C
into table B. If your tables are identical, they should be merged
into 1. then you don't need to copy anything, just find the row in
form B and give instruction to form A to move to that row.

I considered using the RecordsetClone function for this. But
since the RecordsetClone property setting makes a copy of the
underlying table specified by the form's RecordSource
property, that won't work for me since there are three tables
in play here.

Any and all suggestions on how I could possibly accomplish
this would be GREATLY appreciated!
I think we need to understand the purpose of your forms so that we
can find an alternative solution.

Bob Q.
Thanks!!!

Tom


Nov 12 '05 #2
Tlm
Bob,

Thank you for your posting. The situation I'm facing with this issue is
this:

This database tracts publications. The main form (FrmA - TablA) maintains
data regarding an overall ORDER to be sent to a printer; order #, name,
date, etc. The subform in the order form (SubFrmB - TblB) maintains data
regarding particular JOBS in the order; colors to be used, paper weight,
etc. (there are often 20 or more jobs to an order). The subform in the jobs
subform maintains data regarding the DISTRIBUTION of the jobs; how many go
here, how many go there, etc. (there are often 20 or more separate
distribution destinations for each job).

Many jobs are often very similar, but have one or two different values in
some fields. The user wants to be able to 'copy' a job (along with its
distribution data) and 'paste' it in a new order - then modify as required.
The intent is to save the user all that redundant data entry, and potential
type-Os, (there are over 50 fields on the job - SubFrmB - form alone). So,
it's not exactly redundant data. But nearly.

I take your point about there being actually THREE recordsets here. And
your recommendation that I use three separate append queries sounds logical.
But how?

Thank you again!!!

Tom



"Bob Quintal" <bq******@generation.net> wrote in message
news:b1******************************@news.teranew s.com...
"Tlm" <t.*******@comcast.net> wrote in
news:hvdsb.174780$Fm2.153056@attbi_s04:
Hello All,

I have a form (FrmA) with a subform (SubFrmB) embedded in it.
SubFrmB also has a subform embedded in it (SubFrmC) The form's
recordsource is based on a table (TblA). SubFrmB's
recordsource is also based on a table (TblB). SubFrmC's
recordsource is also based on a table (TblC).

There is a one-to-many relationship between TblA (one) and
TblB (many). There is a also a one-to-many relationship
between TblB (one) and TblC(many). The forms are similarly
linked.

I want to be able to copy the recordset in SubFrmB - along
with its many records in SubFrmC - so I can then insert that
recordset as a new record in FrmA.


What you want to do is only possible if the three tables have
identical structures. You are seesntially talking that you want to
copy a row from table B into Table A and the row(s) from Table C
into table B. If your tables are identical, they should be merged
into 1. then you don't need to copy anything, just find the row in
form B and give instruction to form A to move to that row.

I considered using the RecordsetClone function for this. But
since the RecordsetClone property setting makes a copy of the
underlying table specified by the form's RecordSource
property, that won't work for me since there are three tables
in play here.

Any and all suggestions on how I could possibly accomplish
this would be GREATLY appreciated!


I think we need to understand the purpose of your forms so that we
can find an alternative solution.

Bob Q.

Thanks!!!

Tom

Nov 12 '05 #3
"Tlm" <t.*******@comcast.net> wrote in
news:Xursb.181803$Fm2.164376@attbi_s04:
Bob, Thank you for your posting. The situation I'm facing with
this issue is this: This database tracts publications. The main form (FrmA -
TablA) maintains data regarding an overall ORDER to be sent to
a printer; order #, name, date, etc. The subform in the order
form (SubFrmB - TblB) maintains data regarding particular JOBS
in the order; colors to be used, paper weight, etc. (there are
often 20 or more jobs to an order). The subform in the jobs
subform maintains data regarding the DISTRIBUTION of the jobs;
how many go here, how many go there, etc. (there are often 20
or more separate distribution destinations for each job).

Many jobs are often very similar, but have one or two
different values in some fields. The user wants to be able to
'copy' a job (along with its distribution data) and 'paste' it
in a new order - then modify as required. The intent is to
save the user all that redundant data entry, and potential
type-Os, (there are over 50 fields on the job - SubFrmB - form
alone). So, it's not exactly redundant data. But nearly.

I take your point about there being actually THREE recordsets
here. And your recommendation that I use three separate
append queries sounds logical. But how?
So you are not moving the recordset of table B into table A, but
making a copy in table B.

How do you compose order#, job# and Distribution#? and what is the
nature of the relations between tables. Does the distribution table
have the job # as a foreign key? To tell you specifically how to
clone the records, we need to know this,.

You will definitely need a good bit of code here to do what you
want.

I'd plan it out this way.

Create a new Order in table A. this gives you a new order number.
Have a "clone order" button on the form that asks for a clonefrom#,
copies all the records for table B having order# = clonefrom#, but
replacing order# with cloneto#.

Then the code selects all the records in table C that have a Job#
record that has the cloneto# as its order#. Now you have to insert
the records into Table C again, but update the job#s in tables B
and C to reflect the new job#s.

Thank you again!!!

Tom



"Bob Quintal" <bq******@generation.net> wrote in message
news:b1******************************@news.teranew s.com...
"Tlm" <t.*******@comcast.net> wrote in
news:hvdsb.174780$Fm2.153056@attbi_s04:
> Hello All,
>
> I have a form (FrmA) with a subform (SubFrmB) embedded in
> it. SubFrmB also has a subform embedded in it (SubFrmC) The
> form's recordsource is based on a table (TblA). SubFrmB's
> recordsource is also based on a table (TblB). SubFrmC's
> recordsource is also based on a table (TblC).
>
>
>
> There is a one-to-many relationship between TblA (one) and
> TblB (many). There is a also a one-to-many relationship
> between TblB (one) and TblC(many). The forms are similarly
> linked.
>
>
>
> I want to be able to copy the recordset in SubFrmB - along
> with its many records in SubFrmC - so I can then insert
> that recordset as a new record in FrmA.


What you want to do is only possible if the three tables have
identical structures. You are seesntially talking that you
want to copy a row from table B into Table A and the row(s)
from Table C into table B. If your tables are identical, they
should be merged into 1. then you don't need to copy
anything, just find the row in form B and give instruction to
form A to move to that row.
>
>
>
> I considered using the RecordsetClone function for this.
> But since the RecordsetClone property setting makes a copy
> of the underlying table specified by the form's
> RecordSource property, that won't work for me since there
> are three tables in play here.
>
>
>
> Any and all suggestions on how I could possibly accomplish
> this would be GREATLY appreciated!


I think we need to understand the purpose of your forms so
that we can find an alternative solution.

Bob Q.
>
>
>
> Thanks!!!
>
>
>
> Tom
>
>
>



Nov 12 '05 #4

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

Similar topics

6
by: Geir Baardsen | last post by:
Hi! This is a routine for copying a recordset into a new order. It has worked fine under Win98. However, my client has changed to Win XP, and suddenly it doesn't work anymore. I keep getting the...
1
by: Geir Baardsen | last post by:
Hi! As you can see I have worked with my code and done some changes. Now the code will execute, because of this, and because I took away some code in the OnCurrent event that was probably causing...
3
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
2
by: josephm | last post by:
Hello Group: My first post on the group.Hope I get a response. I have a modest Fire Insurance ACCES Db.Thanks to this group - for the code. A "wanna be programmer"... "LEARNS" The code...
7
by: Eric | last post by:
I want to open up 2 record sets. Then, copy everything from one record set to another (excluding a few fields). Is this possible? I need to exclude my primary key, and fields starting with...
4
by: Jim Devenish | last post by:
I wish to copy a table on a SQL Server backend to a table on an Access (.mdb) front end in the simplest way. I have the following to get the recordset but am seeking something easier. Dim...
2
by: mustang123 | last post by:
Hi, I get data from sybase server using ADO Connection and disconnected recordset in my access Database. Now I have a disconnected recordset. I want to insert the contents of this recordset...
3
by: Richnep | last post by:
Hi all, I have tabbed subforms where I need to copy one field value from one subform over to another subform. Although I can run an update query to accomplish this I would like to do it through...
0
by: Neelesh2007 | last post by:
Hi all, I have project with VB6.0 and Access-2003. I have datagrid and ADODC as datasource to retrieve records from database. To export the data of datagrid to Excel I am using Copy From Recordset...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.