DateDiff Function Example

The example displays the number of days between a given date and today.  To try this example, draw a text box, a label, and a command button on a new form.  Set the AutoSize property of the Label to True.  Paste this code over the Form_Load procedure, and then press F5 to run the program.

Sub Command1_Click ()
  Label1.Caption = "Days from today: " & DateDiff("d", Now, Text1.Text)
End Sub