View Single Post
  #85  
Old November 4th, 2008, 04:14 AM posted to microsoft.public.access
Tony Toews [MVP]
external usenet poster
 
Posts: 3,776
Default VBA - GET / SET ??

"Clif McIrvin" wrote:

Question for more experienced developers: in this case, where this
recordset object will (resumably) be used multiple times during each
instance of the form being opened for use would it be better (more
efficient?) to move the Dim rst As Recordset to the module level, the
Set rst = Me.RecordsetClone to the form load event, and the Set rst =
Nothing to the form unload event?


No. The Dim doesn't take any resources other than a small amount of
RAM. The Set rs = currentdb.openrecordset does consume resources and
takes time.

Also to open a form in a separate instance takes a certain amount of
unusual VBA code. Opening a form which is already open will
essentially close the existing form and open it again.

Darn, I thought I had a web page documenting that but looks like I
never got around to it. Real Soon Now (TM Jerry Pournelle)

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/