Pausing OnClick

A

amanda_jb

Can anyone tell me how I can pause until my first command has run? I'm
trying to set the Recordsource data, have the criteria entry run upon doing
so and then a filter run off the criteria which was entered. Problem is
without any type of pause, it replays the Criteria message twice. I'm using
this to do a filter search for data in a different table and the only way I
could come up with was to create a form with the search criteria entered
there. If there's a better way, totally up for hearing that as well. Please
le tme know if I can give better detail, but thought I'd see if I'm going the
right way before I get into it.

Thank you!!!
 
A

Arvin Meyer [MVP]

DoEvents turns all activity over to the operating system, so all code
execution stops. Whereas the api, puts an actual pause in the code for n
period, allowing Access to still be in control.

I use DoEvents when there's an outside process running, like opening Outlook
and adding an attachment.
 
A

amanda_jb

It seems like it will work and I ran the code in a module which worked, but
how do I place this in my code? I saved the code in the module and placed
the Call Sleep (which is what i named the module) where I want my pause and
received an error. Help???

thank you!!
 

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