Module Wait_Function
    Sub Delay(ByVal dblSecs As Double)
        Const Onesec As Double = 1.0# / (1440.0# * 60.0#)
        Dim dblWaitTil As Date
        dblWaitTil = Now.AddSeconds(Onesec).AddSeconds(dblSecs)
        Do Until Now > dblWaitTil
            Application.DoEvents()
        Loop
    End Sub

End Module
