If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Duplicating Recordsets
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. -- HTH Van T. Dinh MVP (Access) "Andy" wrote in message ... 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? |
#2
|
|||
|
|||
Duplicating Recordsets
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 -- -Larry- -- "Andy" wrote in message ... 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? |
#3
|
|||
|
|||
Duplicating Recordsets
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? Rosco ----- 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? . |
#4
|
|||
|
|||
Duplicating Recordsets
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 ! -----Original Message----- 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. -- HTH Van T. Dinh MVP (Access) "Andy" wrote in message ... 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? . |
#5
|
|||
|
|||
Duplicating Recordsets
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. -----Original Message----- 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 -- -Larry- -- "Andy" wrote in message ... 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? . |
Thread Tools | |
Display Modes | |
|
|