View Single Post
  #4  
Old 11-04-2005, 02:05 AM
davidm davidm is offline
Valued Forum Contributor
 
Join Date: 03 Mar 2005
Posts: 303
davidm is becoming part of the community
Problem solved!

Thanks Mac.

Unfortunately, the idea is not just to delete the code. I need the procedure to self-destruct after a specified date.

I have since my last post been able to come up with the following which serves the purpose. (The message boxes are for debugging only and may not be required in actual application).

Sub CodeToExpireAfterDateA()
Dim x As Date

x = #11/05/2008#
If x > Now() Then
MsgBox "Code is alive" 'optional
Call TimedCode
Else
MsgBox "Code has passed used-by date" 'optional
Exit Sub

End If

End Sub


The routine of course returns "Code is alive" in this instance and calls up "TimedCode". But run after midnight of 11/05/2008, the 2nd message should be returned and the procedure exited.


David


David
Reply With Quote