Duplicating Recordsets

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

I want to take data from a table, modify it and put it in
a report without changing the original table data.
OpenTable links the rst to the table data as does .clone.
OpenSnapshot locks the records for modification. I ended
up using a temp table, but this isn't very elegant. How
can I create a modifiable copy of a recordset independent
of the original?
 
What kind of changes are you making. Can these modifications be a calculation against fields in your orginal table
Rosc

----- Andy wrote: ----

I want to take data from a table, modify it and put it in
a report without changing the original table data.
OpenTable links the rst to the table data as does .clone.
OpenSnapshot locks the records for modification. I ended
up using a temp table, but this isn't very elegant. How
can I create a modifiable copy of a recordset independent
of the original
 
AFAIK, Recordsets are just different "views" of data in the Tables so you
cannot modify data in the "views" without modifying data in the Tables.

Thus, the temp. Table is the correct solution.
 
Hi Andy,

You didn't give us any idea of how much data, in terms of the number of
fields, you are changing. That information can make a difference ... You
can write some code to get done what you want but the cost/benefit ratio is
something you'd have to decide. If you've never done it before, I suggest
you try the following on at least one field:

In all cases, you'll create new field names in the QBE grid and follow them
with colons. If the change can be made with a fairly simple formula then
do something like: MyNewFieldResult: =(OldField1*3.14) . If there is a lot
of conditional code and complex calculation involved then write a function
procedure in the report module. and call it as follows; MyNewFieldResult:
=MyNewFunction(Field1). MyNewFunction will be written to return the correct
result.

The report must refer to your new field names rather than to the fields they
replace.

HTH
 
I'm doing a 'what-if' scenario, so I don't want to change
my original table data. If all recordsets in Access are
linked to tables, I guess there's no choice but to use a
temp table. Thanks, Rosco.

-----Original Message-----
What kind of changes are you making. Can these
modifications be a calculation against fields in your
orginal table?
 
Thanks for your reply, Van. I think I get the picture.
Access is all table driven and a recordset is just a
subset of a table(s). I have a lot to learn. From now on,
temp tables it is !
 
Hey, Larry, I was doing a 'what-if' scenario, so I didn't
really want to add more fields to the original table. A
temp table is the way to go, I guess.

You mentioned 'cost/benefit ratio' in your posting. Do
you know if Access has any measurements like machine
cycles, run time or bytes of code etc. that could be used
to compare code or write it more efficiently?

Thanks for your reply.
 
Back
Top