
28-Jul-2006, 08:01 AM
|  | Guest | | | | | | | | | | RecordsetClone theory Hi, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/9347-recordsetclone-theory.html
In the MS Accesguide "VB for App's" I read about finding a record in a table
by using Set rst => RecordsetClone => Findfirst => Bookmark => etc. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
In the book it says that, with using the property RecordsetClone, a copy of
the recordset is made, you work in the copy, and at the end the changes in
the copy are put in the original recordset.
My question is: why is Access/VB not working DIRECTLY IN THE ORIGINAL
RECORDSET, but via the clone ?
I'm sure the must be a logical reason, but don't see it and can't find it
in the tutorial.
Can anyone please explain ?
Thank you in advance
--
eric
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh! | 
28-Jul-2006, 08:01 AM
|  | Guest | | | | | | | | | | Re: RecordsetClone theory "eric" wrote in message
news:80975D22-60AD-4E9D-A620-4236346D7BF0@microsoft.com
> Hi,
>
> In the MS Accesguide "VB for App's" I read about finding a record in
> a table by using Set rst => RecordsetClone => Findfirst => Bookmark
> => etc.
> In the book it says that, with using the property RecordsetClone, a
> copy of the recordset is made, you work in the copy, and at the end
> the changes in the copy are put in the original recordset.
>
> My question is: why is Access/VB not working DIRECTLY IN THE ORIGINAL
> RECORDSET, but via the clone ?
> I'm sure the must be a logical reason, but don't see it and can't
> find it in the tutorial.
>
> Can anyone please explain ?
> Thank you in advance
Three reasons:
1. Until Access 2000, the form's recordset was not directly accessible.
The form had no (public) Recordset property, only the RecordsetClone
property.
2. Actions performed directly on the form's recordset (obtained via the
Recordset property) are reflected immediately on the form. That
includes navigation -- if you move in the form's recordset, the form's
currently displayed record changes. If you perform an AddNew on the Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
form's recordset, the form displays the "new record".
Sometimes, that's what you want. Other times it isn't. For example, if Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
you just want to position the form to a different record located by
FindFirst, it's perfectly okay to do this:
Me.Recordset.FindFirst "ID=" & lngIDtoFind
.... instead of this:
With Me.RecordsetClone
.FindFirst "ID=" & lngIDtoFind
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
On the other hand, if you want to look at some record in the form's
recordset *without changing the record displayed on the form*, then you
must use the RecordsetClone, because navigation in the form's
RecordsetClone is not reflected on the form.
3. Also, form events are not raised by any of the actions you may take
on the RecordsetClone. But actions performed on the form's Recordset,
because they are reflected on the form, may cause form events to fire.
This may or may not be desirable.
--
Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup) | 
28-Jul-2006, 08:01 AM
|  | Guest | | | | | | | | | | Re: RecordsetClone theory I'm fairly new to the VBA side of things. Did you say that any changes
made to the recordset clone are then saved to the original forms recordset
automatically?
"Dirk Goldgar" wrote in message
news:%23JmFSLGdGHA.4932@TK2MSFTNGP03.phx.gbl...
> "eric" wrote in message
> news:80975D22-60AD-4E9D-A620-4236346D7BF0@microsoft.com
>> Hi,
>>
>> In the MS Accesguide "VB for App's" I read about finding a record in
>> a table by using Set rst => RecordsetClone => Findfirst => Bookmark
>> => etc.
>> In the book it says that, with using the property RecordsetClone, a
>> copy of the recordset is made, you work in the copy, and at the end
>> the changes in the copy are put in the original recordset.
>>
>> My question is: why is Access/VB not working DIRECTLY IN THE ORIGINAL
>> RECORDSET, but via the clone ?
>> I'm sure the must be a logical reason, but don't see it and can't
>> find it in the tutorial.
>>
>> Can anyone please explain ?
>> Thank you in advance
>
> Three reasons:
>
> 1. Until Access 2000, the form's recordset was not directly accessible.
> The form had no (public) Recordset property, only the RecordsetClone
> property.
>
> 2. Actions performed directly on the form's recordset (obtained via the
> Recordset property) are reflected immediately on the form. That
> includes navigation -- if you move in the form's recordset, the form's
> currently displayed record changes. If you perform an AddNew on the
> form's recordset, the form displays the "new record". Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
>
> Sometimes, that's what you want. Other times it isn't. For example, if
> you just want to position the form to a different record located by
> FindFirst, it's perfectly okay to do this:
>
> Me.Recordset.FindFirst "ID=" & lngIDtoFind
>
> ... instead of this:
>
> With Me.RecordsetClone
> .FindFirst "ID=" & lngIDtoFind
> If Not .NoMatch Then
> Me.Bookmark = .Bookmark
> End If
> End With
>
> On the other hand, if you want to look at some record in the form's
> recordset *without changing the record displayed on the form*, then you
> must use the RecordsetClone, because navigation in the form's
> RecordsetClone is not reflected on the form.
>
> 3. Also, form events are not raised by any of the actions you may take
> on the RecordsetClone. But actions performed on the form's Recordset,
> because they are reflected on the form, may cause form events to fire.
> This may or may not be desirable. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
> | 
28-Jul-2006, 08:02 AM
|  | Guest | | | | | | | | | | Re: RecordsetClone theory "BW" wrote in message
news:OoaLOfHdGHA.4128@TK2MSFTNGP05.phx.gbl
> I'm fairly new to the VBA side of things. Did you say that any
> changes made to the recordset clone are then saved to the original Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
> forms recordset automatically?
I'm not sure what you mean. Both the form's recordset and the clone of
that recordset are linked to the same table or tables. Changes to the
records and fields in one will be reflected in the other, so data Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
changes made to the recordsetclone will be apparent on the form.
However, the form's recordset is linked to the form, so the current
record in the recordset is the current record on the form, and
navigation in the recordset also navigates the form. But the
recordsetclone is not linked directly to the form, so you can navigate
in the recordsetclone without affecting the form.
--
Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup) | 
28-Jul-2006, 08:02 AM
|  | Guest | | | | | | | | | | Re: RecordsetClone theory Hi Dirk, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
Understanding WHY makes it easier for me to remember the programming code.
You helped me on that. Thank you very much !
Hi BW,
Dirk answered my question but I leave it up to you to conclude the thread,
in case you need to go on on this.
Greetings
--
eric
"Dirk Goldgar" wrote:
> "BW" wrote in message Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
> news:OoaLOfHdGHA.4128@TK2MSFTNGP05.phx.gbl
> > I'm fairly new to the VBA side of things. Did you say that any
> > changes made to the recordset clone are then saved to the original
> > forms recordset automatically?
>
> I'm not sure what you mean. Both the form's recordset and the clone of
> that recordset are linked to the same table or tables. Changes to the
> records and fields in one will be reflected in the other, so data
> changes made to the recordsetclone will be apparent on the form.
> However, the form's recordset is linked to the form, so the current
> record in the recordset is the current record on the form, and
> navigation in the recordset also navigates the form. But the
> recordsetclone is not linked directly to the form, so you can navigate
> in the recordsetclone without affecting the form.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
> | 
28-Jul-2006, 08:02 AM
|  | Guest | | | | | | | | | | Re: RecordsetClone theory Dirk, You response clarified my question. I was misunderstanding
"RecordsetClone" to mean a static copy of the forms data. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
Thanks
Brent
"Dirk Goldgar" wrote in message
news:%23Bh0SqLdGHA.1436@TK2MSFTNGP05.phx.gbl...
> "BW" wrote in message
> news:OoaLOfHdGHA.4128@TK2MSFTNGP05.phx.gbl
>> I'm fairly new to the VBA side of things. Did you say that any
>> changes made to the recordset clone are then saved to the original
>> forms recordset automatically?
>
> I'm not sure what you mean. Both the form's recordset and the clone of
> that recordset are linked to the same table or tables. Changes to the
> records and fields in one will be reflected in the other, so data
> changes made to the recordsetclone will be apparent on the form.
> However, the form's recordset is linked to the form, so the current
> record in the recordset is the current record on the form, and
> navigation in the recordset also navigates the form. But the
> recordsetclone is not linked directly to the form, so you can navigate Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9347
> in the recordsetclone without affecting the form.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
> | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Gurbani Jukebox | Listen to Gurbani while surfing SPN! | » Recent Discussions | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | » Books You Should Read... | | | |