Form takes a long time to load after adding a command button (1 Viewer)

anasttin

New member
Local time
Today, 13:11
Joined
Sep 5, 2016
Messages
5
I've got a form that loads when my access database does.

It works fine, until I add a particular command button to run a query.

Can anyone advise why adding a command button should slow it all down considering that I already have other command buttons running other queries on the form?

Any help would be greatly appreciated.

Many thanks guys,

Ana
 

sneuberg

AWF VIP
Local time
Today, 13:11
Joined
Oct 17, 2014
Messages
3,506
The mere presence of a command button shouldn't cause a form to load slower. I suspect something else happened. I suggest removing that command button, do a compact and repair. Test to see if the form loads ok. And then try adding the command button again.
 

anasttin

New member
Local time
Today, 13:11
Joined
Sep 5, 2016
Messages
5
Thanks sneuberg but I already tried that.

With the button (linked to a query) on the form, it takes about 40 seconds to load the database but without the button, it takes about 4 seconds.

No other buttons being added or deleted seem to do that.

Very strange.

Any other thoughts?

Thanks in advance for your help.
 

JHB

Have been here a while
Local time
Today, 21:11
Joined
Jun 17, 2012
Messages
7,732
Yeah - sound strange, could you post your database, zip it.
 

Minty

AWF VIP
Local time
Today, 20:11
Joined
Jul 26, 2013
Messages
10,355
It sounds like possible form corruption.
Make a new blank form , add a new button that does what the problem one does, see how long it takes to load. If it's normal then it would indicate likely corruption - I would make a backup copy of your db, then create a new empty db and import all the objects into it, see if that cures the problem.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:11
Joined
Jan 20, 2009
Messages
12,849
How long does the query take to run? Be aware that Access will begin to display records as soon as some are available so records appearing almost immediately in the query is not the whole story.

If the query includes an Order By or, as perhaps is your case, the form displaying the results has Order imposed, then no records will display until all records are returned because ordering cannot begin until all results are available. If it takes forty seconds to return all results then nothing will appear on the form until that time has elapsed.
 

Users who are viewing this thread

Top Bottom