Q:

Creating a scheduled action in VBA

I am writing something that will perform an action on a scheduled delay based on a user input.  I think I am close but it is not performing as I would expect it to.  I keep getting a negative result.  This is what I have so far:
    If SchedMsgBox = vbNo Then
        Exit Sub
    Else
      Delay = "Y"
      CurTime = Now()
      DeployDt = Format(Me.cmbSchedDT.Value, "mm/dd/yyyy")
     '   MsgBox ("DeployDate: " & DeployDt)
      DeployTime = Format(Me.lstSchedTime.Value, "hh:mm AMPM")
     '   MsgBox ("DeployTime: " & DeployTime)
      DeployDateTime = DeployDt & " " & DeployTime
     '   MsgBox ("DeployDateTime: " & DeployDateTime)
     '   DelayTimeMin = DateDiff("n", CurTime, DeployDateTime)
      DelayTime = DateDiff("s", CurTime, DeployDateTime)
     '   MsgBox ("DelayTimeInSec: " & DelayTime)

    End If

Any Ideas what I have wrong?
*Delay Time being the final product of seconds that the procedure will be delayed. 
Deploytime and Deploy Date come from the User input. 

A:

If the issue is that you get a negative value for DelayTime from this line ...
DelayTime = DateDiff("s", CurTime, DeployDateTime)

... that would be reasonable if DeployDateTime is earlier than CurTime.  
Here is an Immediate window example ...
CurTime = Now()
? CurTime
12/16/2013 11:57:06 AM 
DeployDateTime = "2013-12-16 11:30"
? DateDiff("s", CurTime, DeployDateTime)
-1626 

Although DeployDateTime is text rather than Date/Time datatype in my example and in your code, DateDiff cooperates by casting it to Date/Time when it computes the difference.  I don't see how that type difference would be creating a problem here.
Perhaps you just need to swap the order of the 2 time arguments.
? DateDiff("s", DeployDateTime, CurTime)
 1626 

