URGENT: get macro to pause, get module to run

T

theintern

I have a macro called TriFilter2. I need it to pause midway for about 10
seconds, then continue on. So, i was advised to make it a module. I did
(via the convertor). Then i created a macro to run it, using RunCode and the
module name. but nothing happens when i run the macro. below is code for
the module. even if i take the Wait() out, it still doesn't work. i'm on
Access 2007.

Option Compare Database

'------------------------------------------------------------
' TriFilter2
'
'------------------------------------------------------------
Public Function TriFilter2vba()

DoCmd.SetWarnings False
DoCmd.OpenQuery "SMquery", acViewNormal, acEdit
DoCmd.OpenQuery "PIPquery", acViewNormal, acEdit
DoCmd.OpenQuery "PLBquery", acViewNormal, acEdit
Call Shell("""C:\Program Files\Microsoft Office\OFFICE11\WINPROJ""
""C:\Documents and Settings\deckers\Desktop\Take-off""", 1)
Call Shell("""C:\Program Files\Microsoft Office\Office12\POWERPNT""
""C:\Documents and Settings\deckers\Desktop\ScheduleOutput.pptm""", 1)
DoCmd.SetWarnings True

End Function

Publice Funcion Wait()
waitTime = 10
Start = Timer
While Timer < Start + waitTime
DoEvents
Wend
End Function

thanks
scott
 
T

theintern

when i call it i type TriFilter2() in the function box. just like that.
maybe that's wrong? and i'm trying to fix this in the next 2 hours....tick
tock.... ;)
 
T

theintern

correction: i type TriFilter2vba(), the name of the module, not the filter.
sorry, this is such a pain.
 
S

Steve Schapel

Scott,

The Module where you have the Function should not be named the same as
the function.
 

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