DELAY FUNCTION how to? PLEASE HELP!!

Shelby1991

New member
Local time
Today, 14:39
Joined
Sep 4, 2013
Messages
6
I am building a faux Electronic Medical Records database for the purpose of training med students. I need a command button to pull up a report , but i want to delay the opening of the report (as if waiting for "tests" to come back or be uploaded) is there a way to do this with VBA? i read about the sleep api but i dont know how to get it to work or where to put the code



so what would i add and where would i add it to delay opening the report that is called EKG W/ Subreport

any help would be appreciated, when it comes to VBA i am a newb.
 
yes, but what is mostly confusing me is; where do i put the code? i am terrible with vba.

alternately, is there an easy way to delay or toggle visibility of a sub-report in a report? that would meet my needs as well
 
The first bit:

Code:
Private Declare Sub sapiSleep Lib "kernel32" _
        Alias "Sleep" _
        (ByVal dwMilliseconds As Long)

Sub sSleep(lngMilliSec As Long)
  If lngMilliSec > 0 Then
    Call sapiSleep(lngMilliSec)
  End If
End Sub

Would go in a standard module. You'd use it in your code with

Call sSleep(3000)

using the appropriate value. You could use the timer event of the report to delay display of the subreport too.
 

Users who are viewing this thread

Back
Top Bottom