pause for 5 seconds

lala

Registered User.
Local time
Today, 17:14
Joined
Mar 20, 2002
Messages
741
how can i do that in VBA?

thank you
 
like this:
Code:
dim pausetime as variant, start as variant

   pausetime = 5
   start = timer
      do while timer < start + pausetime
         do events
      loop
 
thank you!!!!!!!!!!

if you have a few minutes, can you please explain how this works

i saw similar example in the help file, tried using it (after taking out things i didn't need) and couldn't do it

and i still don't understand why your example worked

the DoEvents makes it start?
 
but the thing underlying this is, why do you want to wait five seconds - if you are waiting for another process to complete something, then there are probably better ways since perhasps 5 secs isnt enough anyway.
 
and i still don't understand why your example worked

the DoEvents makes it start?
it's better to not understand the way code works. just go with it. ;)

Anyway, the doevents issue stops the execution of a procedure in order to allow other things to process, whatever they may be. In this case, nothing will happen, as in...no processes need to run, and therefore the program's procedure is basically paused for 5 seconds. the timer starts and approches 5 seconds. when it's there, the loop ends.
 
but the thing underlying this is, why do you want to wait five seconds - if you are waiting for another process to complete something, then there are probably better ways since perhasps 5 secs isnt enough anyway.

i have a form that has a bunch of dlookups and formulas on it, about 40, as i said before

and then i have a query that copies those values into a table

and after each selection (there's 108 combinations that i need those numbers for) it takes 3-4 seconds for the dlookups to display

so to avoid getting blanks copied into the table i'm pausing it to give it time to calculate and then running the query



i got it to work, but i agree with you 100%, this is an ugly way of doing it
so if you have any ides - i'd really appreciate it


and thank you


and thank you ajetrumpet for the explanation
 
it's better to not understand the way code works. just go with it. ;)

Anyway, the doevents issue stops the execution of a procedure in order to allow other things to process, whatever they may be. In this case, nothing will happen, as in...no processes need to run, and therefore the program's procedure is basically paused for 5 seconds. the timer starts and approches 5 seconds. when it's there, the loop ends.

from what i understood, you're saying that you can pause Access to allow other things to run?
can you give an example of why you'd need to pause Access and what might run during the pause?
 
but the thing underlying this is, why do you want to wait five seconds - if you are waiting for another process to complete something, then there are probably better ways since perhasps 5 secs isnt enough anyway.

gemma, i explained to you why i need to pause access and if there's a better way to get it done - i'd love to hear about it

any ideas?
 
ok, i just took off the pause all together and it seems to work

stupid question, just because i don't see the numbers on the screen, doesn't mean they're not actually there?

that's what it seems like...
 
gemma, i explained to you why i need to pause access and if there's a better way to get it done - i'd love to hear about it

any ideas?

no , i often get problems having formulas "catch up", and i never really found a 100% reliabel solution
 
Why not make the ending of the dlookups trigger the copying instead to avoid copying blanks?
 

Users who are viewing this thread

Back
Top Bottom