开发者

Set rs = nothing : useful before closing form ?

In Access, always supposed that in Forms modules, as in other (class or regular) modules, objects and normal variables cease to exist when the code is exited, or in the case of Forms, w开发者_如何转开发hen the form is closed. Is that correct ?

I am wondering because I built a form used to scan barcodes on orders, and it gets slower and slower during the day, until the user closes and reopens the DB, then everything is back to normal. Closing the form does not seem to be enough. I analysed my code, and I can't find much, so serching for the culprit...


I think ideally when objects go out of scope they will be destroyed and the memory they used will be released. However, since sometimes things don't go according to plan, I thought we're supposed to explicitly close and release any recordset objects we create in our code ... just to be safe.


Is this form being opened and closed many times during the session? I had a problem in Access 97 where a similar problem would occur. Hideing the form instead of closing it and then making it visible again solved the problem. However any form level variables had to be explicitly set to zero or zero length strings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜