Slow when closing a form

B

Ben

Environment:
1. Front-End - MS Access 2003
2. Back-End - SQL Server 2005
3. OS - Windows XP


I cannot understand why it takes a 5-7 seconds to close our Invoice form.
The Invoice form has several data components in it that retrieves data.

The code in the "Done" button of the form perform the following:
a. Me.Requery
b. Check other loaded forms "IsLoaded()"
c. DoCmd.Close

The form has also a code in the "Close" event which only checks for loaded
forms again "IsLoaded()".


Thanks,

Ben
 
A

Albert D. Kallal

The code in the "Done" button of the form perform the following:
a. Me.Requery

Why would you execute a command to re-load, and have the form re-pull all
data down from the server? If we on the way out of this form, I see little,
if any reason to force a data re-load of the form? This makes no sense at
all? (perhaps you want some code that forces a disk write of the current
record?...if yes, then use:

if me.Dirty = true then
me.dirty = false
end

Also, is this a mde, mdb? Is the front end installed on EACH computer?
 
T

Tony Toews [MVP]

Ben said:
I cannot understand why it takes a 5-7 seconds to close our Invoice form.
The Invoice form has several data components in it that retrieves data.

The code in the "Done" button of the form perform the following:
a. Me.Requery
b. Check other loaded forms "IsLoaded()"
c. DoCmd.Close

The form has also a code in the "Close" event which only checks for loaded
forms again "IsLoaded()".

In addition to Albert's posting I do wonder why you are running the
code for loaded forms twice.

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top