UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Dbopensnapshot Vs Recordset Clone, Access 2010    
 
   
SemiAuto40
post Jun 13 2018, 12:09 PM
Post#1



Posts: 602
Joined: 3-April 12
From: L.A. (lower Alabama)


I am simply wanting to use a FindFirst to see if a method number is in tbl_Methods. I'm sure there are multiple ways of achieving this. Is there an advantage to using a recordset clone instead of using dbOpenSnapshot to navigate and perform the FindFirst?

Thanks in advance.
Go to the top of the page
 
theDBguy
post Jun 13 2018, 12:22 PM
Post#2


Access Wiki and Forums Moderator
Posts: 72,396
Joined: 19-June 07
From: SunnySandyEggo


Hi,

You could also simply use either DLookup() or DCount() to find if a method number exists.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
SemiAuto40
post Jun 13 2018, 12:33 PM
Post#3



Posts: 602
Joined: 3-April 12
From: L.A. (lower Alabama)


But is there an advantage to using those functions on the actual table - on a Snapshot or a Recordset Clone?
Go to the top of the page
 
theDBguy
post Jun 13 2018, 12:36 PM
Post#4


Access Wiki and Forums Moderator
Posts: 72,396
Joined: 19-June 07
From: SunnySandyEggo


Hi,

The advantage I see is you don't have to create an object at all.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
projecttoday
post Jun 13 2018, 02:09 PM
Post#5


UtterAccess VIP
Posts: 9,691
Joined: 10-February 04
From: South Charleston, WV


I'm not familiar with Snapshot. You're asking about recordset clones so you must be talking about forms. These days forms have a recordset and a recordset clone. If you use one of those for reading data you will get the form's data. If you Dlookup you will read the table again. This could cause some inconsistency as far as the display goes because another user could update the table in the meantime (or that could be an advantage, depending on the situation).

--------------------
Robert Crouser

My company's website
Go to the top of the page
 
AlbertKallal
post Jun 13 2018, 04:04 PM
Post#6


UtterAccess VIP
Posts: 2,633
Joined: 12-April 07
From: Edmonton, Alberta Canada


If you are talking about an existing forms recordset?

Form.RecordsetClone:

This in “many” if not often is the better choice. This “clone” of the forms recordset is preferable WHEN:

You want to find, loop, or process records, and do this independently of the forms current record. So you are free to “find” or “move next” etc., and the form will not jump around, o follow what you do.

Form.RecordSet

The above means you are hitting + using the SAME record source as the form. If you do a find, or move next etc. the form will FOLLOW these actions. So in fact, if you WANT the form to jump and follow say a “find”, then the form will follow whatever and wherever you move the record pointer to.


Form.RecordSet.Clone

Note the above – you can always “clone” an existing reocrdset, and that includes the forms built in reocrdset. However, I can’t think of EVER having to do this with the built in forms recordset. (the reason being is that this “clone” will result in exactly the “same” thing as me.RecordSetClone.

So any dao recordset can be “cloned” via rst.Clone – but I can’t imagine the need for this against a form’s recordset since we have the built in me.RecordSetClone for this anyway.


So do keep in mind the above 3 choices. You often use above 1, or 2 as a choice – it really depends if you need/want the form to “jump” and follow the move-next of the record pointer when you change it.

So say to total up a sub form (continues) of many records, you would loop + sum up the values, and use reocrdsetClone because you don’t need nor want the form to “jump around” and follow your record processing loop.

However for a “find”, you may well want to use me.RecordSet, since then you don’t need additional code to “jump” the form to some found record like you would with me.RecordSetclone.

So the “heads up” tip here is that ReocrdSetClone is a “copy” or “clone” of the forms recordset, and you can move around in that recordset undependability without the form following/jumping along with your code.

So you have as above shows 3 choices, but the 3rd choice never been used by me - in what 15+ years of Access?

So the choice really comes down to if you want/need the form to jump and follow along with record movement you execute in code.

Regards
Albert D. Kallal (Access MVP, 2003-2017)
Edmonton, Alberta Canada

Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    19th June 2018 - 08:50 PM